請看這頁here。jquery animate()IE9和chrome - 奇怪的bahaviour!
這是jquery animate()的一個非常簡單的功能,可以將標題文本動畫化到頁面頂部 - 這就是全部!
在FF和Opera中它是完美的。
在IE9中,它首先跳轉到頁面底部,然後進行動畫處理。
在Chrome中,它跳轉到頁面的頂部,然後動畫下來!
wtf!
jQuery的電話是:
$(function(){
$('#name_holder').click(function(){
$('#name_holder_wrap').animate(
{top: '75px'}
, 500
, 'swing'
, function() {
$('#name_holder').attr({"style": 'cursor:default'});
}
);
});
});
,這裏是所涉及的元素的CSS:
#name_holder_wrap {
padding: 0px;
width: 100%;
position: absolute;
height: auto;
top: 45%;
}
#name_holder {
padding: 0px;
width: 600px;
height: auto;
text-align: center;
margin-right: auto;
margin-left: auto;
display: block;
cursor: pointer;
}
(對不起,我還沒有完全得到我的頭一輪是如何把代碼插入到這些帖子正確 - 無法讓那些閉合的大括號包含在代碼塊中 - 我試圖!)
所以,我真的很感激任何指針 - 我已經與它搏鬥了幾個小時現在,真的需要繼續!
非常感謝提前!
斯科特
在IE9中爲我工作正常!然而,Chrome就像你所描述的那樣。 – Sapph 2011-04-03 08:51:30