1
我想在垂直自動滾動(以一種速度)的文本中獲取文本並暫停,當用戶將光標懸停在它上面但似乎無法讓我的代碼工作。我該如何去實現這個目標?這是到目前爲止我的代碼:jQuery垂直自動滾動不起作用
的JavaScript
$('#scroll').children().animate({'margin-top': '-=' + ($('#scroll').children().height()-100)}, 10000);
HTML
<div id="scroll">Content here and more content here<br />
<br />
Content here and more content here<br />
<br />
Content here and more content here<br />
<br />
Content here and more content here<br />
<br />
Content here and more content here<br />
<br />
Content here and more content here<br />
<br />
Content here and more content here<br />
<br />
Content here and more content here<br />
<br />
Content here and more content here<br />
<br />
Content here and more content here<br />
<br />
Content here and more content here<br />
<br />
Content here and more content here<br />
<br />
Content here and more content here<br />
<br />
Content here and more content here </div>
此外,我還上傳了我的代碼在這裏:http://jsfiddle.net/5DmZh/。
+1爲好的解決方案,我也試圖做這樣的事情。 –