我有这样的代码:JQuery的,错误的左翼位置
$(this).closest("p").after('<strong>' + arMess[iCurIndex] + '</strong>').next().animate({
top: $(this).offset().top - 57,
left: -$(this).width() //[First value] Here i get 148px on chrome and 150px on firefox
}, 300,function(){
alert($(this).offset().top - 57);
alert(-$(this).width()); //[Second value] Here i get the true width the one i want to present the left
});
代码概述: 在第一线我动画STRONG元素
正如你可以看到我得到2个不同的值从- $(this).width():
第一个值:我在动画过程中获得。
第二个值:我得到的动画结束后。
如果有人有大约原因想法,我得到2个不同的价值观,我将非常感激。
我只是想..有边界也许问题?尝试使用'outerWidth',而不是'width' – 2013-04-06 11:03:27