I'm using jQuery to allow the user the dynamically change the padding of a DIV containing text.
I'm using a range slider that fires off the following to updated the container DIV's padding on change:
$('#preview > div').css('padding', ui.value + '%' );
In Firefox this works fine, but in Chrome not all of the elements are being updated to reflect the new padding. The easiest way to explain is with pictures:
1. In image 1, the padding is at 5% and both the headline and the paragraph text is centered in the DIV as it should be.
2. In image 2, I have increased the padding equally around the text, which should cause the heading and paragraphs to compress into narrower a column, but still centered on the page. As you can see, only the first paragraph is being properly updated as I change the padding.
Once this is done, and with the text incorrectly positioned, if I change another style property (such as changing the heading font), it immediately causes all elements in the page to be refreshed, and positioned correctly.
Is there a command I can use to force jQuery to recalculate the positioning of every element inside the DIV?
Thanks!