For some reason, the correct filling of the right side of the document does not appear properly on the display when you try to change the padding-right value using JavaScript after the page loads. Check out this fiddle that demonstrates the problem.
HTML
<html><body><div></div></body></html>
Javascript
setTimeout(function () {
$(document.body).css('padding-right', '100px');
$(document.body).append('timeout function executed');
}, 1000);
http://jsfiddle.net/gyqEK/2/
There were some workarounds, how I was able to make the changes in the correct addition effective
- resize browser window
- switch the display of the document body to none and through the timeout function with a zero millisecond back to the block
- write some HTML content in a div (in the example script)
Windows Chrome, Ubuntu 12.04 Chrome 24 . Firefox . - - , / Chrome?
, , . "-" ( "div" ), , . Firefox, Chrome.
$('div').click(function () {
var jqBody = $(document.body);
if (jqBody.css('padding-right') !== '200px') {
jqBody.animate({
'padding-right': '200px'
}, 500);
} else {
jqBody.animate({
'padding-right': '0'
}, 500);
}
});
http://jsfiddle.net/gyqEK/5/
, . , 200 , div . , div, , , div div. Chrome.