爱易网
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 浏览次数:20284 次
以下是程序代码
<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
上一篇:狡猾的按钮特效
下一篇:页面左侧上下滚动的图片
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
小灵通两年都无信号 顾客起诉联通公司
苹果售后生态链乱象:供需失衡价钱不一
中移动财报外的"五座大山":运营商沦为走秀陪衬
纸媒深探版权蓝海抗衡互联网的时机到来了
Twitter收购印度手机营销公司ZipDial
神州电脑中止IPO面前:再被质疑财务造假
苹果CEO抱歉解读:是战略而非“屈服”
广东移动董事长徐龙受调查 圈内对其褒贬不一
这一次,微软将带给我们什么惊喜?
推荐阅读
更多>
曝阿里巴巴一怀孕员工过劳死 加班情况引争议
扎克伯格华裔妻子首度亮相电视节目畅谈情史
蘑菇街CEO陈琪:2015将回归社会化电商
虚拟运营市场躁动:山西煤老板兴味浓重
“组合拳”怎么打 拆解小米新玩法
巨人网络回应央视 否认应用黑客停止诈骗
英特尔IDF峰会启示:释放移动互联的信号
谷歌董事长成花花公子:情史足以媲美涂鸦
易信工具性优势突出 丁磊三板斧或先砍在飞信上
谷歌欲收买WhatsApp添加砝码 对方否认
国网公司将加快组建 业界人士称困难重重
打车软件火了 恶性循环来了
金山毒霸安全中心: XP退役后首个高危漏洞来了
IT时代周刊总编辑曹健:投资人刘志硕印象记
同样的背景,罗永浩和雷军到底有什么不同?
Twitter收购印度手机营销公司ZipDial
盘点改变社会的15种科技:谷歌眼镜将使我们成为半机械人
易迅大众点评缩水执行“七天后悔权”被约谈
火一把就死: 百度魔图验证社交游戏衰亡宿命
中电信率先推移动转售业务 中下旬批量上市