我正在使用jQuery在水平视图网站上对齐图像,但该脚本仅在我重新加载页面时才有效.
http://joliannelm.steveforest.com/edition/roux-de-service.html
该脚本就在之前调用
这是脚本:
$(document).ready(function() {
var width = 0;
$('#page img').each(function() {
width += $(this).outerWidth(true);
});
$('#page').css('width', width + 50);
});
Run Code Online (Sandbox Code Playgroud)
一旦重新加载页面就可以了,但是如果你清除了缓存,它就会回来......
有人知道为什么?? 谢谢.