爱易网
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 浏览次数:20247 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>爱易网网页特效演示,字幕滚动效果(二)</title> </head> <body> <script type="text/javascript"> //<![CDATA[ <!-- function scrollerObj(name,initH,initW,heightB,widthB,content,initBg,Bg,speed,initFl){ //**data**// this.name=name; this.initH=initH; this.initW=initW; this.heightB=heightB; this.widthB=widthB; this.content=content; this.initBg=initBg; this.Bg=Bg; this.iniFl=initFl; this.speed=parseInt(speed); this.timer = name + "Timer"; this.elem; //**methods**// this.getElement = getElement; this.createLayer=createLayer; this.scrollLayer = scrollLayer; this.scrollLoop=scrollLoop; //**initiate methods**// this.createLayer(); this.getElement(); this.scrollLayer(); } //**call this method to stop scrolling**// function scrollLoop(s){ this.speed = s; } //**pretty obvious**// function scrollLayer(){ if(parseInt(this.elem.style.top)>(this.elem.offsetHeight*(-1))){ this.elem.style.top = parseInt(this.elem.style.top)-this.speed; //alert(parseInt(this.elem.style.top)+"\n"+this.elem.id); } else {this.elem.style.top = this.initH;} } //**get the specific dom-expression**// function getElement(){ if(document.getElementById){ this.elem = document.getElementById(this.name); } else if (document.all){ this.elem = document.all[name]; } else if (document.layers){ this.elem = document.layers[name]; } } //**pretty obvious - if NS4 - please upgrade to a standard compliant browser**// function createLayer(){ if(document.getElementById || document.all){ document.write('<div id="layer'+this.name+'" style="position:relative;overflow:hidden;float:'+this.initFl+';background-color:#'+this.initBg+';border:1px solid black;width:'+this.initW+'px;height:'+this.initH+'px;" onMouseover="'+this.name+'.scrollLoop(0)" onMouseout="'+this.name+'.scrollLoop('+this.speed+')">'); document.write('<div id="'+this.name+'" style="position:absolute;top:'+this.initH+'px;left:0px;border:0px solid black;width:'+this.widthB+'px;height:'+this.heightB+'px;background-color:#'+this.Bg+'">'); document.write(this.content); document.write('<\/div><\/div>');} else if(document.layers){ document.write('<ilayer name="'+this.name+'" bgcolor="#'+this.Bg+'" width="'+this.widthB+'" height="'+this.heightB+'">'+this.content+'<\/ilayer>'); return; } if(this.scrollLayer){ this.timer = setInterval(this.name+'.scrollLayer()','30'); } } //--> //]]> </script> <style media="screen" type="text/css"> /*<![CDATA[*/ <!-- P{color:#465d5c;margin:3px;} A{color:#e86500} H1{color:#465d5c;font-size:11px;font-weight:normal;font-weight:bold;font-size:11px;font-family:Arial,Helvetica,Geneva,Swiss,SunSans-Regular;margin:3px; padding:0px} H2{color:#465d5c;font-size:11px;font-weight:bold;font-size:11px;font-family:Arial,Helvetica,Geneva,Swiss,SunSans-Regular;margin:3px; padding:0px} .art{font-weight:normal;font-size:11px;font-family:Arial,Helvetica,Geneva,Swiss,SunSans-Regular;width:100%;border-top:1px solid #FFFFFF;border-bottom:1px solid #FF7F00; padding:3px;margin-bottom:10px;text-align: justify;} .state{color:#e86500;margin-left:5px;margin-right:5px;} #art1{background-color:#FFBB00;} #art2{background-color:#FFCC00;}
上一篇:狡猾的按钮特效
下一篇:字幕滚动效果(四)
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
虚拟运营商温度有多高?降温OR升温内外有别
微信收费形式三选一 腾讯或变身运营商
佳能利润大跌三成 智能终端倒逼相机厂商转型
小米年度发布会遭围剿!多款新品难阻品牌危机
传诺基亚Lumia928下月推出 将与iPhone5看齐
世界杯让耐克阿迪大打出手 谁能劈开用户大脑?
网曝富士康“二连跳” 疑因推静音模式
网络文学竞争白热化 百度多酷文学网上线
HTC的三大迷惘:高管釜底抽薪 产品营销战略混乱
推荐阅读
更多>
蜗牛移动董事长石海:号卡被叫停属乌龙事件
苹果收购Beats交易或将延期尚需解决5大问题
亚马逊落户上海自贸区:美国货直邮中国
中移动“重启”自有品牌手机成败难料
打车App就是下一个团购骗局!?
中移动财报外的"五座大山":运营商沦为走秀陪衬
谷歌董事长成花花公子:情史足以媲美涂鸦
唯品会荣登“最贵中概股”的欢喜与哀愁
途牛开盘价9美元 与发行价持平
从3G牌照发放看中国4G规划效果
2018双11阿里云老用户怎么参加拼团活动 老用户拼团方法
优酷土豆兼并一年:依然处于烧钱形状
淘宝公布新规:升级售假卖家惩罚力度
国美痛批网购七宗罪 用短暂盈利输了未来
MIUI,有了它小米就无惧对手
华为野心布局未来:投资研发5G对赌1毫秒连接
美国电影协会在华起诉迅雷侵权 要求赔偿并道歉
史玉柱谈创业:5大建议 失败的教训最真实
支付宝全面封杀比特币:充值码淘宝店或遭封禁
墨迹天气:产品创新以攻为守方能对抗巨头