⑴ 在three.js中怎样让自动播放的全景图停止
< div id="div1" style="cursor:hand;position:absolute;width:500;height:190;overflow:hidden;border:1 solid red" onmouseover="clearTimeout(scrl);" onmousemove="getpos()" onmouseout="change(1);"><img src=http://www.jb51.net/upload/out500b.jpg onload="change(1);"></div>< script> var scrl,direction="right"; var x,xold,xdiff, i=1; function change(start){ if(direction == "right"){ if(div1.scrollTop+190< div1.scrollHeight){ div1.scrollTop += 190; } else{ div1.scrollTop = 0; } } else{ if(div1.scrollTop-190 > 0){ div1.scrollTop -= 190; } else{ div1.scrollTop = div1.scrollHeight; } } if(start) scrl = setTimeout("change(1)",100); else clearTimeout(scrl); } function getpos(){ x = event.clientX; xdiff = x - xold; xold = x; if(xdiff>0) direction = "right"; if(xdiff<0) direction = "left"; change(0); }< /script>
如需引入外部Js需刷新才能执行
⑵ js鎬庢牱鍋滄涓寮犲浘鐗囩殑鍔犺浇
浣犳妸閭e紶姝e湪鍔犺浇鐨勫浘鐗囧厓绱犻殣钘忚捣鏉ュ氨濂藉暒,鐒跺悗缁х画鎵ц屼綘鎯宠佹墽琛岀殑鍑芥暟