100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > js实现精美的图片跟随鼠标效果实例【javascript】

js实现精美的图片跟随鼠标效果实例【javascript】

时间:2022-03-27 10:30:15

相关推荐

js实现精美的图片跟随鼠标效果实例【javascript】

web前端|js教程

js,图片,跟随鼠标

web前端-js教程

本文实例讲述了js实现精美的图片跟随鼠标效果实现方法。分享给大家供大家参考。具体实现方法如下:

仿卷皮源码手机,vscode有中文吗,ubuntu修复grud,安卓配置tomcat,sqlite两个表数据相减,googplay爬虫,php免费空间申请,孟村seo整站优化价格,企业内部系统网站制作,sf网站模板lzw

精美js鼠标跟随代码A=document.getElementByIdB=document.all;C=document.layers;T1=new Array("trail1.jpg",38,35,"trail2.jpg",30,31,"trail3.jpg",28,26,"trail4.jpg",22,21,"trail5.jpg",16,16,"trail6.jpg",10,10)var offsetx=15 var offsety=10nos=parseInt(T1.length/3)rate=50ie5fix1=0;ie5fix2=0;rightedge=B? document.body.clientWidth-T1[1] : window.innerWidth-T1[1]-20bottomedge=B? document.body.scrollTop+document.body.clientHeight-T1[2] : window.pageYOffset+window.innerHeight-T1[2]for (i=0;i<nos;i++){createContainer("CUR"+i,i*10,i*10,i*3+1,i*3+2,"","")}function createContainer(N,Xp,Yp,W,H,At,HT,Op,St){with (document){write((!A && !B) ? "<layer left="+Xp+" top="+Yp+" width="+W+" height="+H : "

" : ">");write((HT) ? HT : "");if (!Op)closeContainer(N)}}function closeContainer(){document.write((A || B)?"

":"")}function getXpos(N){if (A)return parseInt(document.getElementById(N).style.left)else if (B)return parseInt(B[N].style.left)elsereturn C[N].left}function getYpos(N){if (A)return parseInt(document.getElementById(N).style.top)else if (B)return parseInt(B[N].style.top)elsereturn C[N].top}function moveContainer(N,DX,DY){c=(A)? document.getElementById(N).style : (B)? B[N].style : (C)? C[N] : "";if (!B){rightedge=window.innerWidth-T1[1]-20bottomedge=window.pageYOffset+window.innerHeight-T1[2]}c.left=Math.min(rightedge, DX+offsetx);c.top=Math.min(bottomedge, DY+offsety);}function cycle(){//if (IE5) if (document.all&&window.print){ie5fix1=document.body.scrollLeft;ie5fix2=document.body.scrollTop;}for (i=0;i<(nos-1);i++){moveContainer("CUR"+i,getXpos("CUR"+(i+1)),getYpos("CUR"+(i+1)))}}function newPos(e){moveContainer("CUR"+(nos-1),(B)?event.clientX+ie5fix1:e.pageX+2,(B)?event.clientY+ie5fix2:e.pageY+2)}function getedgesIE(){rightedge=document.body.clientWidth-T1[1]bottomedge=document.body.scrollHeight-T1[2]}if (B){window.onload=getedgesIEwindow.onresize=getedgesIE}if(document.layers)document.captureEvents(Event.MOUSEMOVE)document.onmousemove=newPossetInterval("cycle()",rate)

同城源码,vscode找不到路径,ubuntu密码钥匙,tomcat部署自启动,sqlite设置数据库大小,爬虫爬自己学校网站可以吗,php 匹配html标签,烟台seo优化推广行业,网站图片延迟加载,政府发言模板lzw

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。