我有这个代码来调整图像的位置
$(window).load(function() {
center();
});
$(window).resize(function() {
center();
});
function center() {
var pos = $('#banner img').width() - $(window).width();
$('#banner img').css({
left : pos / 2 * -1
});
}
我知道使用 jQuery(function($) 所以它不会与其他 jquery 库中的其他 $(document).ready 发生冲突。如何编写它以便 $(window).load & resize 不会发生冲突?并且限制也是版本 1.8.3。谢谢。