Home > Web Front-end > JS Tutorial > body text

JS realizes 360-degree rotation of panorama effect_image special effects

WBOY
Release: 2016-05-16 19:21:57
Original
2167 people have browsed it

[Ctrl A select all Note: If you need to introduce external Js, you need to refresh to execute
]<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>
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template