⑴ 在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湪鍔犺澆鐨勫浘鐗囧厓緔犻殣鈃忚搗鏉ュ氨濂藉暒,鐒跺悗緇х畫鎵ц屼綘鎯寵佹墽琛岀殑鍑芥暟