簡體   English   中英

使用jQuery使div動畫上下

[英]Make div animate up and down with jQuery

我試圖在鼠標懸停事件期間讓div從當前位置上下移動 - 我有跟隨但它只能工作一次然后停止而不是繼續騎自行車?

tiptitle.stop(true, true).animate({
    'top': '5px'
}, 100).stop(true, true).animate({
    'top': '0px'
}, 100);

做一個無限循環

function animate(isOpen) {
    tiptitle.stop().animate({'top': isOpen ? '5px' : '0px'}, 100, function() { animate(!isOpen); })
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM