爱易网
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 浏览次数:20203 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>网页特效代码|JsCode.CN|---左右交叉合并导航效果</title> </head> <BODY onload=initiate()> <script> <!-- Beginning of JavaScript - // Edit your messages. You can add as many messages a you like. var message = new Array() message[0]="欢迎光临国内最大的新闻站点---新浪网!" message[1]="欢迎光临国内最大的综合性站点---网易!" message[2]="欢迎光临国内最大的搜索引擎站点---搜狐!" message[3]="欢迎光临国内最大的游戏站点---第九城市!" // The links of your messages. Be sure that you configure as many links as messages. // If don't want to link your messages write '#' instead of an URL (see last sample). var messageurl = new Array() messageurl[0]="http://../www.sina.com.cn/default.htm" messageurl[1]="http://../www.163.com/default.htm" messageurl[2]="http://../www.sohu.com/default.htm" messageurl[3]="http://../www.the9.com/default.htm" var messagetarget=new Array() messagetarget[0]="_blank" messagetarget[1]="_blank" messagetarget[2]="_blank" messagetarget[3]="_blank" // The width of your textbox (pixels). // Be sure that 'textwidth' is slightly bigger than the 'width' configured inside the stylesheet var textwidth=260 // The height of your textbox (pixels) // Be sure that 'textheight' is slightly bigger than the 'height' configured inside the stylesheet var textheight=75 // Final horizontal position of the textbox: distance to the left margin of the window (pixels) // IMPORTANT: // if you want to center the textbox in the middle of the browser-window then write -1. // If you want to place the textbox on an absolute position // then write the number (for instance 223). var x_finalpos=-1 // Final vertical position of the textbox: distance to the top margin of the window var y_finalpos=20 // Total number of textslices var textslices=10 // Standstill of textbox (seconds) var pausetext=5 // Speed of horizontal gliding var step=10 var pause=40 // Do not edit the variables below this line var x_rightspans=0 var x_leftspans=0 var marginright var marginleft var height_slice=Math.floor(textheight/textslices) var cliptop=0 var clipbottom=cliptop+height_slice var clipleft=0 var clipright=textwidth var spannummer=0 var spannrbefore=0 var i_message=0 pausetext=pausetext*1000 function initiate() { if (document.all) { if (x_finalpos==-1) { x_finalpos=Math.floor(document.body.clientWidth/2)-Math.floor(textwidth/2) } changemessage() } } function changemessage() { for (i=0;i<=textslices-1;i++) { var thisspan=eval("span"+i) thisspan.innerHTML="<a href='"+messageurl[i_message]+"' target='blank'>"+message[i_message]+"</a>" } gostartposition() } function gostartposition() { for (i=0;i<=textslices-1;i+=2) { var thisspan=eval("document.all.span"+i+".style") thisspan.posLeft=marginright } for (i=1;i<=textslices-1;i+=2) { var thisspan=eval("document.all.span"+i+".style") thisspan.posLeft=marginleft } moveslices_IE() } function moveslices_IE() { if (x_rightspans==0 || x_leftspans==0) { if (x_rightspans==0) { for (i=0;i<=textslices-1;i+=2) { var thisspan=eval("document.all.span"+i+".style") thisspan.posLeft-=step } if (thisspan.posLeft<=x_finalpos) { x_rightspans=1 for (i=0;i<=textslices-1;i+=2) { var thisspan=eval("document.all.span"+i+".style") thisspan.posLeft=x_finalpos } } } if (x_leftspans==0) { for (i=1;i<=textslices-1;i+=2) { var thisspan=eval("document.all.span"+i+".style") thisspan.posLeft+=step } if (thisspan.posLeft>=x_finalpos) { x_leftspans=1 for (i=1;i<=textslices-1;i+=2) { var thisspan=eval("document.all.span"+i+".style") thisspan.posLeft=x_finalpos } }
上一篇:狡猾的按钮特效
下一篇:媲美Flash的JS导航菜单
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
二代 iPad Air将配备2GB内存?为同屏多任务做准备
国网公司将加快组建 业界人士称困难重重
英特尔承认,联想最新K系列智能手机放弃英特尔处理器
蜗牛移动董事长石海:号卡被叫停属乌龙事件
十亿美元的告别礼:三星为何要大举重组?
百度透露无人驾驶战略 研发三维交通地图
微软张亚勤趋势判断:未来三十年属于物理化互联网
世界杯让耐克阿迪大打出手 谁能劈开用户大脑?
可靠消息称微型针孔偷拍设备拟全面禁止
推荐阅读
更多>
诺基亚因充电器问题暂停销售Lumia 2520平板电脑
Facebook以“人”为本的名义占领安卓
历史惊人相似:如今的库克 曾经的鲍尔默
“合聚变”来了 UC优视确认并入阿里巴巴
虚拟运营商们更像三大运营商的“二道贩子”
扎克伯格华裔妻子首度亮相电视节目畅谈情史
网易云音乐能否为丁磊拿到移动互联网门票?
乐视28日发布手机进展 LeUI系统Mobile版或曝光
微软史上最大规模裁员,一半诺基亚员工
中国雅虎邮箱今日关停 由盛及衰的背后
谷歌欲收买WhatsApp添加砝码 对方否认
Twitter收购印度手机营销公司ZipDial
优酷土豆兼并一年:依然处于烧钱形状
苹果MacBook Air劣势渐显 或推新产品改变命运
NoomWeight减肥
唯品会荣登“最贵中概股”的欢喜与哀愁
逆转猜想:如果阿里成为雅虎大股东会怎样?
Skype周年:与微软联姻到底有没有未来?
小米移动芯片:英伟达退出,终会加强与联发科合作
黑莓高管:黑莓能作为家“小众公司”活下来