【发布时间】:2012-08-03 10:39:15
【问题描述】:
在 chrome 中不工作.... element.offset().top 任何建议
$(window).load(function() {
$(".scroll-box").scroll(function(){
$('#document_activity .doc-draft.item.parent').each(function(i) {
$movingLableTop = [];
$movingLableHeight = [];
$fixedLableTop = $('#fixed_version').find('.version').offset().top;
$movingLableTop.push($(this).offset().top);
$movingLableHeight.push($(this).height());
if ($fixedLableTop > ($movingLableTop + $movingLableHeight)){
$('#fixed_version').find('.version').html($(this).find('.version').html());
}
});
});
});
很多人提到 chrome 无法为 offset() 获得正确的值
【问题讨论】:
-
什么不起作用?它在做什么你意想不到的事情?你指的“很多人”是谁?您使用的是什么版本的 chrome、HTML、JQuery 等?
-
chrome version 版本 21.0.1180.57 jquery v1.7.2 $(this).offset().top 在 chrome 中没有任何工作...
标签: jquery google-chrome offset