爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
漂浮图片碰壁后自动切换效果
漂浮图片碰壁后自动切换效果
日期:2014-05-18 浏览次数:20267 次
以下是程序代码
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="keywords" content="站长,网页特效,js特效,广告代码,zzjs,zzjs.net,sky,www.zzjs.net,站长特效 网" /> <meta name="description" content="www.zzjs.net,站长特效网,站长必备js特效及广告代码。大量高质量js特效,提供高质量广告代码下载,尽在站长特效网" /> <title>漂浮图片碰壁自动切换效果,sky整理收集,zzjs.net欢迎您。</title> </head> <body onLoad="setValues()"> <a href="<#ZC_BLOG_HOST#>">站长特效网</a>,站长必备的高质量网页特效和广告代码。zzjs.net,站长js特效。<hr> <!--欢迎来到站长特效网,我们网站收集大量高质量js特效,提供许多广告代码下载,网址:www.zzjs.net,zzjs@msn.com,用.net打造靓站--> <SCRIPT> var x,y var marginbottom var marginleft=0 var margintop=0 var marginright // 速度,越小越快 var tempo=60 // 单位时间内水平移动的距离 var stepx=20 // 单位时间内上下移动的距离 var stepy=20 var timer // 图象的路径 img0 = new Image(); img0.src = "/image/zzjs.ico"; img1 = new Image(); img1.src = "/image/zzjs.ico"; img2 = new Image(); img2.src = "/image/zzjs.ico"; img3 = new Image(); img3.src = "/image/zzjs.ico"; // 延迟两秒开始运动 function setValues() { var firsttimer= setTimeout("setValues2()",100)} function setValues2() { if (document.all) { marginbottom = document.body.clientHeight-50 marginright = document.body.clientWidth-50 document.all.ball.style.posLeft=randommaker(marginright-30)+30 document.all.ball.style.posTop=10 moveball() } if (document.layers) { marginbottom = window.innerHeight-10 marginright = window.innerWidth-10 document.ball.left=randommaker(marginright-30)+30 document.ball.top=10 moveball() } }//欢迎来到站长特效网,我们的网址是www.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。 function randommaker(range) { rand=Math.floor(range*Math.random()) return rand } function moveball() { checkposition() chooseimage() if (document.all) { document.all.ball.style.posLeft+=stepx document.all.ball.style.posTop+=stepy timer=setTimeout("moveball()",tempo) } if (document.layers) { document.ball.left+=stepx document.ball.top+=stepy timer=setTimeout("moveball()",tempo) } }//欢迎来到站长特效网,我们的网址是www.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。 function checkposition() { if (document.all) { if (document.all.ball.style.posLeft>=marginright) { stepx=stepx*-1 document.all.ball.style.posLeft-=10 } if (document.all.ball.style.posLeft<=marginleft) { stepx=stepx*-1 document.all.ball.style.posLeft+=10 } if (document.all.ball.style.posTop>=marginbottom) { stepy=stepy*-1 document.all.ball.style.posTop-=10 } if (document.all.ball.style.posTop<=margintop) { stepy=stepy*-1 document.all.ball.style.posTop+=10 } } if (document.layers) { if (document.ball.left>=marginright) { stepx=stepx*-1 document.ball.left-=10 } if (document.ball.left<=marginleft) { stepx=stepx*-1 document.ball.left+=10 } if (document.ball.top>=marginbottom) { stepy=stepy*-1 document.ball.top-=10 } if (document.ball.top<=margintop) { stepy=stepy*-1 document.ball.top+=10 } } }//欢迎来到站长特效网,我们的网址是www.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。 function chooseimage() { if (document.all) { if (stepx <= 0 && stepy <=0) {ballimage.src="/image/1.jpg"} if (stepx >= 0 && stepy <=0) {ballimage.src="/image/2.jpg"} if (stepx <= 0 && stepy >=0) {ballimage.src="/image/3.jpg"} if (stepx >= 0 && stepy >=0) {ballimage.src="/image/4.jpg"} }//欢迎来到站长特效网,我们的网址是www.zzjs.net,很好记,zz站长,js就是js特效,本站收集大量高质量js代码,还有许多广告代码下载。 if (document.layers) { if (stepx <= 0 && stepy <=0) {document.ball.document.ballimage.src="/image/1.jpg"} if (stepx >= 0 && stepy <=0) {document.ball.document.ballimage.src="/image/2.jpg"} if (stepx <= 0 && stepy >=0) {document.ball.document.ballimage.src="/image/3.jpg"} if (stepx >= 0
上一篇:狡猾的按钮特效
下一篇:页面左侧上下滚动的图片
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
喜大普奔:2016年国内乘客有望在飞机上使用手机
苹果联合创始人炮轰鲍尔默“一直都在吃老本”
苹果6月20日发布iPhone5S 触摸屏概念股生动
FB上广告费用昂贵而且效果不及Twitter
云储存有多远:跨过数据安全问题即可到达
Docker Desktop 4.11 发布:支持虚拟桌面、Mac 权限更改和新扩展
乐视28日发布手机进展 LeUI系统Mobile版或曝光
索尼移动中国区陷裁员风波:业务不佳 员工焦虑
京东微信入口战略能否助力618大促创流量巅峰
推荐阅读
更多>
同样的背景,罗永浩和雷军到底有什么不同?
百度“全网寻人”面前的互联网信息枢纽价值
苹果30亿美元收购Beats
估值增长9.8% 阿里IPO前市值达2450亿美元
中移动一季度净利大降:手机补贴增长过快
百视通:Xbox One汉化获批 游戏迷欢呼吧
国内云服务商存在尴尬:“远程机房+移动大硬盘”模式
说说这一个月的赌球输了多少
《中国三网融合业务运营管理》研讨报告征订函
独立工具APP:为亿级用户的商业化而愁
Kindle入华遭遇国内厂商“围剿 ” 电信也参战
途牛旅游网今晚挂牌纳斯达克 融资1亿美元
Android版WhatsApp曝漏洞:聊天记录可被窃取
英特尔技术高管离任 电视业务或受影响
乐视28日发布手机进展 LeUI系统Mobile版或曝光
华为、小米和联想在中国手机市场上演“三国杀”
乐视今日临时停牌 受广电酝酿新规消息影响
苹果大中华区业绩回暖 中移动贡献或低于预期
苹果iWatch或使用量产液态金属 将取代玻璃
王建宙解构OTT效劳 中移动重塑飞信平台