爱易网
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 浏览次数:20241 次
以下是程序代码
<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
上一篇:狡猾的按钮特效
下一篇:页面左侧上下滚动的图片
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
AMD Q1净亏1.46亿美元 转战SOC拥抱ARM求变
诺基亚因充电器问题暂停销售Lumia 2520平板电脑
靠价格战赚取资费套餐利润差,虚拟运营商必死无疑
电信资费新政:三巨头压力大 短期降价仍有争议
盛大游戏走向衰落的根源:免费游戏模式惹的祸
三大运营商获通知大减营销费 传3年减400多亿
从百度世界大会看大数据
凑足了升级ios8所需要的5.7G空间,没料到“苹果”却变成“板砖”,iOS8还能一起愉快玩耍吗?
微软谷歌高层访韩面前:忌惮三星的崛起
推荐阅读
更多>
三星石墨烯制备技术获突破
联通丹东公司一高管造假套出手机变卖被判刑7年
三问刘强东:京东为何近来火气这么大?
蜗牛移动董事长石海:号卡被叫停属乌龙事件
微软与摩托罗拉授权协议涵盖Android和Chrome设备
只有切到刚需痛点,漫画APP才能走下去
中移动将推出多项4G资费新政
微软确认 Surface 计划更多尺寸和LTE 版本
网曝富士康“二连跳” 疑因推静音模式
Facebook财报前瞻:投资者仍信心不足
虚拟运营市场躁动:山西煤老板兴味浓重
苹果30亿美元收购Beats
十亿美元的告别礼:三星为何要大举重组?
马斯克的特斯拉能否保持好势头
NEC拟出售移动效劳子公司NEC Mobile
都是300元内 乐视盒子与小米盒子对比体验
9158屌丝逆袭 从在线“夜总会”转型KTV
中国移动4G资费调整方案6月1日起正式实施
诺基亚依托规模效应 猛攻国际市场空白
微软史上最大规模裁员,一半诺基亚员工