您现在的位置是:鼠标控制图片决胜巅峰下载安装加拿大28预测网-开奖lpc预测左右无缝滚动js特效 >>正文
鼠标控制图片决胜巅峰下载安装加拿大28预测网-开奖lpc预测左右无缝滚动js特效
碧血丹心网45人已围观
简介大=快var speed=10;//循环周期(毫秒)大=慢var MyMar=null;function Marquee(){//正常移动var scrollbox = document.getEle...
大=快var speed=10;//循环周期(毫秒)大=慢var MyMar=null;function Marquee(){//正常移动 var scrollbox = document.getElementById("scrollbox"); var scrollcopy = document.getElementById("scrollcopy"); if(dir>0&&(scrollcopy.offsetWidth-scrollbox.scrollLeft)<=0){ scrollbox.scrollLeft=0; } if(dir<0 &&(scrollbox.scrollLeft<=0)){ scrollbox.scrollLeft=scrollcopy.offsetWidth; } scrollbox.scrollLeft+=dir;}function onmouseoverMy(){ window.clearInterval(MyMar);}//暂停移动function onmouseoutMy() { MyMar=setInterval(Marquee,speed);}//继续移动function r_left(){ if(dir==-1) dir=1;}//换向左移function r_right(){ if(dir==1) dir=-1;}//换向右移function IsIE(){ var browser=navigator.appName if((browser=="Netscape")){ return false; } else if(browser=="Microsoft Internet Explorer"){ return true; }else{ return null; }}var _IsIE = IsIE();var _MousePX = 0;var _MousePY = 0;var _DivLeft = 0;var _DivRight = 0;var _AllDivWidth = 0;var _AllDivHeight = 0;function MoveDiv(e){ var obj = document.getElementById("scrollbox"); _MousePX = _IsIE ? (document.body.scrollLeft + event.clientX) : e.pageX; _MousePY = _IsIE ? (document.body.scrollTop + event.clientY) : e.pageY; //Opera Browser Can Support ''window.event'' and ''e.pageX'' var obj1 = null; if(obj.getBoundingClientRect){ //IE obj1 = document.getElementById("scrollbox").getBoundingClientRect(); _DivLeft = obj1.left; _DivRight = obj1.right; _AllDivWidth = _DivRight - _DivLeft; }else if(document.getBoxObjectFor){ //FireFox obj1 = document.getBoxObjectFor(obj); var borderwidth = (obj.style.borderLeftWidth != null && obj.style.borderLeftWidth != "") ? parseInt(obj.style.borderLeftWidth) : 0; _DivLeft = parseInt(obj1.x) - parseInt(borderwidth); _AllDivWidth = Cut_Px(obj.style.width); _DivRight = _DivLeft + _AllDivWidth; }else{ //Other Browser(Opera) _DivLeft = obj.offsetLeft; _AllDivWidth = Cut_Px(obj.style.width); var parent = obj.offsetParent; if(parent != obj){ while (parent){ _DivLeft += parent.offsetLeft; parent = parent.offsetParent; } } _DivRight = _DivLeft + _AllDivWidth; } var pos1,pos2; pos1 = parseInt(_AllDivWidth * 0.4) + _DivLeft; pos2 = parseInt(_AllDivWidth * 0.6) + _DivLeft; if(_MousePX > _DivLeft && _MousePX < _DivRight){ if(_MousePX > _DivLeft && _MousePX < pos1){ r_left(); //Move left } else if(_MousePX < _DivRight && _MousePX > pos2){ r_right(); //Move right } if(_MousePX > pos1 && _MousePX < pos2){ onmouseoverMy(); //Stop MyMar=null; }else if(_MousePX < pos1 || _MousePX > pos2){ if(MyMar==null){ MyMar=setInterval(Marquee,speed); } } }}function Cut_Px(cswidth){ cswidth = cswidth.toLowerCase(); if(cswidth.indexOf("px") != -1){ cswidth.replace("px",""); cswidth = parseInt(cswidth); } return cswidth;}function MoveOutDiv(){ if(MyMar == null){ MyMar=setInterval(Marquee,speed); }}</script><style type="text/css">*{margin:0;padding:0;list-style-type:none;}a,img{border:0;}table{empty-cells:show;border-collapse:collapse;border-spacing:0;}.titbox{font-size:18px;color:#3366cc;height:32px;overflow:hidden;width:880px;margin:20px auto;}.scroll{width:880px;color:#333333;margin:0 auto;overflow:hidden;}.scroll img{border:solid 1px #ddd;margin:0 5px;}.scroll a:hover img{border:solid 1px #990000;}</style> <h2 class="titbox">鼠标放置 容器的左侧或右侧 可以控制图片滚动方向哦</h2> <div class="scroll" id="scrollbox" onMouseMove="MoveDiv(event);" onMouseOut="MoveOutDiv();"> <div id="scrollcon" style="width:100%;"> <table> <tbody> <tr> <td valign="top"> <table width="100%"> <tr> <td><a href="http://www.bokequ.com/tag/jquery" target="_blank" rel="noopener"> <img height="150" width="250" alt="js文字切换特效制作焦点文字带滤镜切换效果" src="images/006BNLLHgy1fmt641lwp0j30hs0qo1dt.jpg" /></a></td> <td><a href="http://www.bokequ.com/tag/jquery" target="_blank" rel="noopener"> <img height="150" width="250" alt="js文字特效制作js文字闪烁与文字变色效果" src="images/006BNLLHgy1fmt63xfow2j31hc0u0u0x.jpg" /></a></td> <td><a href="http://www.bokequ.com/tag/jquery" target="_blank" rel="noopener"> <img height="150" width="250" alt="js文字滚动插件制作双行关联向上文字间隙滚动" src="images/006BNLLHgy1g1ob4wl7stj30u01hc1kx.jpg" /></a></td> <td><a href="http://www.bokequ.com/tag/jquery" target="_blank" rel="noopener"> <img height="150" width="250" alt="js树形导航菜单制作垂直js导航条特效" src="images/006BNLLHgy1g1ob4ye1wlj31c00u0b2a.jpg" /></a></td> <td><a href="http://www.bokequ.com/tag/jquery" target="_blank" rel="noopener"> <img height="150" width="250" alt="js导航菜单左侧竖纵向二级导航菜单可点击展开与收缩子菜单" src="images/006BNLLHgy1g1ob4waomsj30u01hc1kx.jpg" /></a></td> <td><a href="http://www.bokequ.com/tag/jquery" target="_blank" rel="noopener"> <img height="150" width="250" alt="flash导航条制作二级菜单子菜单的flash导航条源码" src="images/006BNLLHgy1g1ob4x19rnj31hc0u04qp.jpg" /></a></td> <td><a href="http://www.bokequ.com/tag/jquery" target="_blank" rel="noopener"> <img height="150" width="250" alt="flash导航条制作一个鼠标滑过动画特效flash导航条源码下载" src="images/006BNLLHgy1g1eueq6x6nj30ys0mmu0x.jpg" /></a></td> <td><a href="http://www.bokequ.com/tag/jquery" target="_blank" rel="noopener"> <img height="150" width="250" alt="flash导航条制作一个鼠标滑过动画特效flash导航条源码下载" src="images/006BNLLHgy1g1ob4xa7xnj31hc0u07wh.jpg" /></a></td> </tr> </table> </td> <td><div id="scrollcopy" style="width:100%;"></div></td> </tr> </tbody> </table> </div> </div><script type="text/javascript"> document.getElementById("scrollcopy").innerHTML = document.getElementById("scrollcon").innerHTML; MyMar=setInterval(Marquee,speed);</script></body></html>
鼠标控制图片左右无缝滚动js特效js演示效果
js代码。" /></head><body><script type="text/javascript">var dir=1;//每步移动像素,j加决胜巅峰下载安装拿大28预测网-开奖lpc预测s图片左右无缝滚动用鼠标控制图片滚动特效,鼠标放置容器的左侧或右侧 可以控制图片滚动方向,通过鼠标感应控制图片左右无缝滚动js代码效果演示,通过鼠标
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>js图片左右无缝滚动带鼠标感应效果 - bokequ.com</title><meta name="description" content="js图片滚动制作图片左右无缝滚动效果,
Tags:
相关文章
苹果酝酿智能家居新布局?'homeOS'商标申请引发热议
鼠标控制图片决胜巅峰下载安装加拿大28预测网-开奖lpc预测左右无缝滚动js特效苹果“homeOS”商标申请引发热议:苹果酝酿智能家居新布局?随着科技媒体 MacRumors 对苹果公司通过名为 Home Operations Suite LLC 的空壳公司,在全球多地提交“ho...
阅读更多
小米新款智能净烟机S20上市:告别油烟困扰,还能实时监测空气质量
鼠标控制图片决胜巅峰下载安装加拿大28预测网-开奖lpc预测左右无缝滚动js特效标题:告别油烟困扰,迎接清新厨房——米家智能净烟机 S20 上市解析随着生活品质的提升,越来越多的人开始关注厨房的健康问题。小米新款智能净烟机 S20 的上市,无疑为消费者提供了一个全新的解决方案。这...
阅读更多
圆形滚动404动画页面特效
鼠标控制图片决胜巅峰下载安装加拿大28预测网-开奖lpc预测左右无缝滚动js特效每个网站都有404提示页面, 这是一款无论从设计到配色都是很好看的404动态提示页面,配合动态404文字,有不错的直觉感受。圆形几何视差滚动404动画页面特效.来移动鼠标跟着404页面一起抖动吧。演示...
阅读更多