為什么我這個鼠標(biāo)放上去滾動速度反而大了呢,越來越快
?<script type="text/javascript">
? ? ? ? ? ? ? ? ? ? ? var are = document.getElementById('sbody');
? ? ? ? ? ? ? ? ? ? ? var con1 = document.getElementById("con1");
? ? ? ? ? ? ? ? ? ? ? var con2 = document.getElementById("con2");
? ? ? ? ? ? ? ? ? ? ? con2.innerHTML = con1.innerHTML;
? ? ? ? ? ? ? ? ? ? ? var time = 50;
? ? ? ? ? ? ? ? ? ? ? are.scrollTop=0;
? ? ? ? ? ? ? ? ? ? ? function scc()
? ? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? if(are.scrollTop>=con1.offsetHeight)
? ? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? are.scrollTop=0;
? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? else{
? ? ? ? ? ? ? ? ? ? ? are.scrollTop++;
? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? ? ? var my = setInterval("scc()",time);?
? ? ? ? ? ? ? ? ? ? ? are.onmouseover = function() {
? ? ? ? ? ? ? ? ? ? ? clearInserval(my);
? ? ? ? ? ? ? ? ? ? ? } ??
? ? ? ? ? ? ? ? ? ? ? are.onmouseout = function()
? ? ? ? ? ? ? ? ? ? ? {
? ? ? ? ? ? ? ? ? ? ? my = setInterval("scc()",time);?
? ? ? ? ? ? ? ? ? ? ? }
? ? ? ? ? ? ? ? ? </script>
2017-08-05
onmouseover 里的 clearInterval 寫成 clearserval 了
2017-08-05
你 onmouseover 里的setInterval 寫錯了