《2022年图片全屏漂浮代码源码精华教程.docx》由会员分享,可在线阅读,更多相关《2022年图片全屏漂浮代码源码精华教程.docx(4页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、2022年图片全屏漂浮代码源码精华教程所谓全屏漂移,当然不会让你悲观.演示:恐怖吧?感觉有点象病毒.代码见下:<SCRIPT>var imagepath= /这里写图片的URLvar imagewidth=88 /这两行写图片的大小var imageheight=31var speed=3;var imageclick= /这里写点击图片连接到的地址var hideafter=0var isie=0;if(window.navigator.appName=Microsoft Internet Explorerwindow.navigator.appVersion.substring
2、(window.navigator.appVersion.indexOf(MSIE)+5,window.navigator.appVersion.indexOf(MSIE)+8)>=5.5) {isie=1;}else {isie=0;}if(isie){var preloadit=new Image()preloadit.src=imagepath}function pop() {if(isie) {x=x+dx;y=y+dy;oPopup.show(x, y, imagewidth, imageheigh
3、t);if(x+imagewidth+5>screen.width) dx=-dx;if(y+imageheight+5>screen.height) dy=-dy;if(x<0) dx=-dx;if(y<0) dy=-dy;startani=setTimeout(pop();,50);}}function dismisspopup(){clearTimeout(startani)oPopup.hide()}function dowhat(){if (imageclick=dismiss)dismisspopup()el
4、sewindow.open(imageclick);}if(isie) {var x=0,y=0,dx=speed,dy=speed;var oPopup = window.createPopup();var oPopupBody = oPopup.document.body;oPopupBody.style.cursor=handoPopupBody.innerHTML = '<IMG SRC='+preloadit.src+'>'oPopup.document.body.onmouseover=new Function(clearTimeout(startani)oPopup.document.body.onmouseout=popoPopup.document.body.onclick=dowhatpop();if (hideafter>0)setTimeout(dismisspopup(),hideafter*1000)}</SCRIPT>(出处: