Shadowbox skinning & sizing - wordpress

How do I skin shadowbox and make sure popup size is fixed size?
The css part is ok since it's just overriding ids and classes.
However, I'm not sure what the markup.js is supposed to look.
So here are my questions:
I created shadowbox-custom-skin/markup.js and added the hook like:
add_filter('shadowbox-markup', 'shadowbox_custom_markup');
Now I can't find an example of how the markup.js is supposed to look.
(I'm trying to put the sb-nav div before the content and the sb-title div below the content and also add some new parameters).
I fixed the size of the popup using this method:
rel="shadowbox;width=480px;height=240px"
handleOversize resize no longer works. Meaning, it will resize content, but it's squeezed.
How do I make sure the popup is the same size, but oversized content isn't squeezed and small content is just centered?

You don't really need to tweak javascript to do this. Using the property inspector on your browser or the Firebug plugin, right click on the Shadowbox and see what css classes/ids are being used. Put those css classes/ids in your own stylesheet apply the styles you want. Then upload the file to your server.

Related

Media query/any other solution to apply CSS on both pop-up and desktop

I have the same content to be displayed on a pop-up and desktop view.
I already used media queries to adjust the content on desktop/mobile view. But in desktop view, the same content needs to be displayed on a pop-up with different margins.
How can I achieve this? Please help. Thank you.
Just add different margin that will overwrite default one based on parent class of the component - in your case it will be pop-up class.
If you do not want to increase CSS specificity - you may try add class modificator (eg component--big-margin) if you are using CSS methodology like BEM.

Embed Gist without vertical scrolling

When I embed a long gist (in this case of a Jupyter Notebook), the resulting box on my website has vertical scrollbars. I'd like to avoid these scrollbars and just have a longer page (in the same way it's on the actual gist website). Is there any way to do this, with CSS or otherwise?
I'm basically looking for the exact opposite to
Make Gist embed scrollable
Note that specifying a minimum height in CSS does not work: It produces a white box of the correct size, but the content is still scrolling in the top part of that box only
As I can check, the embed code inserts an iframe and there is no simply way to detect the height of that document (cross-domain).
This might help: Resize Cross Domain Iframe Height
But keep in mind that the workarounds are overkill, I think.

Enhanced image plugin not working correctly when custom styles have been applied

For my website we use custom style sheets that are stored locally on our server and are injected into the webpages. However when i add them to CKEditor and then attempt to resize or move an image with the enhanced image plugin they cannot be resized or moved at all. Has anyone encountered this problem before? Is there anyway around it?
edit: So i add my css files using
config.contentsCss = ['http://fonts.googleapis.com/css?family=Droid+Sans',
'http://fonts.googleapis.com/css?family=Bree+Serif',
'http://fonts.googleapis.com/css?family=Droid+Sans+Mono',
'http://192.168.0.50/css/new/all.css?v=1" media="all',
'http://192.168.0.50/css/new/templates.css?v=1',
'http://192.168.0.50/css/pre_review/colors.css?v=1',
'http://192.168.0.50/css/pre_review/paged_test.css?v=2',
'http://192.168.0.50/css/pre_review/bootstrap.min.css?v=1',
'http://192.168.0.50/css/pre_review/main.css?v=1',
'text/css'];
I have also installed the Enhanced Image plugin to allow me to resize and move images around. however when i insert an image on to the page the source looks like
<p><img alt="" height="239" src="http://icons.iconarchive.com/icons/yellowicon/game-stars/256/Mario-icon.png" width="239" /></p>
when i originally set the image width and height in the popup panel i set the values to 2 and 2, these values do nothing to edit the actual size of the image. It still displays at the full size of 239x 239.
I know that it is my added styles that are causing this error as it works fine without them, However i do need them. is there anyway around this without having to remove the styles?
First of all, your contentsCss has some weird parts like the last item or this 'http://192.168.0.50/css/new/all.css?v=1" media="all'. Please verify that all this works. Incorrect rules may affect CKEditor.
Second, the issue may be very simple - your CSS most likely affect widgets styling. Disable loading your CSS files one by one and see which one breaks the Enhanced Image plugin. Then find the rule that breaks it and then improve the rule so it does not affect images.

Resizing the window breaks float behavior when using media queries?

I have a site that I'm working that has navigation bar with secondary block-level elements (images in my case) inside the <a> tags which respond to the window size by either floating or not floating. As long as a user never resizes their browser window after loading the page, the issue would never occur, but it appears as though if the page is stretched wide, and then scaled down without reloading the page, the float style attached to the main CSS declaration (not inside a #media query) fails to activate.
http://jsfiddle.net/MrPickle/ace1rtrq/
Here's an example the behavior that I'm seeing (with the same css code I'm using for layout). If you play with the size of the result panel, you can see what I'm talking about.
I know that I could use javascript to monitor the width of the page and add or remove a .left class to the inner element as needed, but I don't think that's the most elegant solution possible. Has anyone ever run into this kind of an issue?

Set textarea height to height of text

I want to use a textarea on a form, but I want it to be a single line high when the content is empty (i.e. on a new form), and only resize to the height of the content on the edit form.
I've been playing around with a few css settings but I'm really not skilled with front-end development, can someone point me in the direction of the attributes I need to be setting to make this happen?
Preferably without JS, but that seems to be the only solution of any I've found thus far. It seems messy and slow when you add in multiple textarea's auto resizing on a single form.
You could use this plugin for jQuery: http://www.jacklmoore.com/autosize

Resources