网站地图
首页
php教程
asp.net教程
手机开发
css教程
网页制作
办公数码
jsp教程
asp教程
ps教程
当前位置:
编程学习网
>>
办公数码
>
excel
> >
[上下滚动代码]上下滚动
[上下滚动代码]上下滚动
发布时间:2016-11-29
【www.gdgbn.com--excel】
提示:您可以先修改部分代码再运行
无标题文档
<script type="text/javascript"> function Marquee() { this.ID = document.getElementById(arguments[0]); if(!this.ID) { alert("您要设置的"" + arguments[0] + ""初始化错误rn请检查标签ID设置是否正确!"); this.ID = -1; return; } this.Direction = this.Width = this.Height = this.DelayTime = this.WaitTime = this.CTL = this.StartID = this.Stop = this.MouseOver = 0; this.Step = 1; this.Timer = 30; this.DirectionArray = {"top":0 , "up":0 , "bottom":1 , "down":1 , "left":2 , "right":3}; if(typeof arguments[1] == "number" || typeof arguments[1] == "string")this.Direction = arguments[1]; if(typeof arguments[2] == "number")this.Step = arguments[2]; if(typeof arguments[3] == "number")this.Width = arguments[3]; if(typeof arguments[4] == "number")this.Height = arguments[4]; if(typeof arguments[5] == "number")this.Timer = arguments[5]; if(typeof arguments[6] == "number")this.DelayTime = arguments[6]; if(typeof arguments[7] == "number")this.WaitTime = arguments[7]; if(typeof arguments[8] == "number")this.ScrollStep = arguments[8]; this.ID.style.overflow = this.ID.style.overflowX = this.ID.style.overflowY = "hidden"; this.ID.noWrap = true; this.IsNotOpera = (navigator.userAgent.toLowerCase().indexOf("opera") == -1); if(arguments.length >= 7)this.Start(); } Marquee.prototype.Start = function() { if(this.ID == -1)return; if(this.WaitTime < 800)this.WaitTime = 800; if(this.Timer < 20)this.Timer = 20; if(this.Width == 0)this.Width = parseInt(this.ID.style.width); if(this.Height == 0)this.Height = parseInt(this.ID.style.height); if(typeof this.Direction == "string")this.Direction = this.DirectionArray[this.Direction.toString().toLowerCase()]; this.HalfWidth = Math.round(this.Width / 2); this.HalfHeight = Math.round(this.Height / 2); this.BakStep = this.Step; this.ID.style.width = this.Width + "px"; this.ID.style.height = this.Height + "px"; if(typeof this.ScrollStep != "number")this.ScrollStep = this.Direction > 1 ? this.Width : this.Height; var templateTop = "MSCLASS_TEMP_HTMLMSCLASS_TEMP_HTML"; var templateTop = "MSCLASS_TEMP_HTMLMSCLASS_TEMP_HTML"; var msobj = this; msobj.tempHTML = msobj.ID.innerHTML; if(msobj.Direction <= 1) { msobj.ID.innerHTML = templateTop.replace(/MSCLASS_TEMP_HTML/g,msobj.ID.innerHTML); } else { if(msobj.ScrollStep == 0 && msobj.DelayTime == 0) { msobj.ID.innerHTML += msobj.ID.innerHTML; } else { msobj.ID.innerHTML = templateLeft.replace(/MSCLASS_TEMP_HTML/g,msobj.ID.innerHTML); } } var timer = this.Timer; var delaytime = this.DelayTime; var waittime = this.WaitTime; msobj.StartID = function(){msobj.Scroll()} msobj.Continue = function() { if(msobj.MouseOver == 1) { setTimeout(msobj.Continue,delaytime); } else { clearInterval(msobj.TimerID); msobj.CTL = msobj.Stop = 0; msobj.TimerID = setInterval(msobj.StartID,timer); } } msobj.Pause = function() { msobj.Stop = 1; clearInterval(msobj.TimerID); setTimeout(msobj.Continue,delaytime); } msobj.Begin = function() { msobj.ClientScroll = msobj.Direction > 1 ? msobj.ID.scrollWidth / 2 : msobj.ID.scrollHeight / 2; if((msobj.Direction <= 1 && msobj.ClientScroll <= msobj.Height + msobj.Step) || (msobj.Direction > 1 && msobj.ClientScroll <= msobj.Width + msobj.Step)) { msobj.ID.innerHTML = msobj.tempHTML; delete(msobj.tempHTML); return; } delete(msobj.tempHTML); msobj.TimerID = setInterval(msobj.StartID,timer); if(msobj.ScrollStep < 0)return; msobj.ID.onmousemove = function(event) { if(msobj.ScrollStep == 0 && msobj.Direction > 1) { var event = event || window.event; if(window.event) { if(msobj.IsNotOpera) { msobj.EventTop = event.srcElement.id == msobj.ID.id ? event.offsetY - msobj.ID.scrollTop : event.srcElement.offsetTop - msobj.ID.scrollTop + event.offsetY; } else { msobj.ScrollStep = null; return; } } else { msobj.EventTop = event.layerY - msobj.ID.scrollTop; } msobj.Direction = msobj.EventTop > msobj.HalfHeight ? 3 : 2; msobj.AbsCenter = Math.abs(msobj.HalfHeight - msobj.EventTop); msobj.Step = Math.round(msobj.AbsCenter * (msobj.BakStep*2) / msobj.HalfHeight); } } msobj.ID.onmouseover = function() { if(msobj.ScrollStep == 0)return; msobj.MouseOver = 1; clearInterval(msobj.TimerID); } msobj.ID.onmouseout = function() { if(msobj.ScrollStep == 0) { if(msobj.Step == 0)msobj.Step = 1; return; } msobj.MouseOver = 0; if(msobj.Stop == 0) { clearInterval(msobj.TimerID); msobj.TimerID = setInterval(msobj.StartID,timer); } } } setTimeout(msobj.Begin,waittime); } Marquee.prototype.Scroll = function() { switch(this.Direction) { case 0: this.CTL += this.Step; if(this.CTL >= this.ScrollStep && this.DelayTime > 0) { this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL; this.Pause(); return; } else { if(this.ID.scrollTop >= this.ClientScroll) { this.ID.scrollTop -= this.ClientScroll; } this.ID.scrollTop += this.Step; } break; case 1: this.CTL += this.Step; if(this.CTL >= this.ScrollStep && this.DelayTime > 0) { this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL; this.Pause(); return; } else { if(this.ID.scrollTop <= 0) { this.ID.scrollTop += this.ClientScroll; } this.ID.scrollTop -= this.Step; } break; case 2: this.CTL += this.Step; if(this.CTL >= this.ScrollStep && this.DelayTime > 0) { this.ID.scrollTop += this.ScrollStep + this.Step - this.CTL; this.Pause(); return; } else { if(this.ID.scrollTop >= this.ClientScroll) { this.ID.scrollTop -= this.ClientScroll; } this.ID.scrollTop += this.Step; } break; case 3: this.CTL += this.Step; if(this.CTL >= this.ScrollStep && this.DelayTime > 0) { this.ID.scrollTop -= this.ScrollStep + this.Step - this.CTL; this.Pause(); return; } else { if(this.ID.scrollTop <= 0) { this.ID.scrollTop += this.ClientScroll; } this.ID.scrollTop -= this.Step; } break; } } //--> </script>
<script type="text/javascript"> var marquee3=new Marquee("marqueediv1"); marquee3.Direction="top"; marquee3.Step=1; marquee3.Width=632; marquee3.Height=52; marquee3.Timer=5; marquee3.ScrollStep=1;//此句禁止鼠标控制 marquee3.Start(); var top0 = document.getElementById("top0");//此句控制兼容FF var bottom1 = document.getElementById("bottom1");//此句控制兼容FF top0.onmouseover=function(){marquee3.Direction=2} top0.onmouseout=top0.onmouseup=function(){marquee3.Step=marquee3.BakStep} top0.onmousedown=bottom1.onmousedown=function(){marquee3.Step=marquee3.BakStep+2} bottom1.onmouseover=function(){marquee3.Direction=3} bottom1.onmouseout=bottom1.onmouseup=function(){marquee3.Step=marquee3.BakStep} </script>
提示:您可以先修改部分代码再运行
本文来源:
http://www.gdgbn.com/bangongshuma/14509/
上一篇:
[选择下拉列表框]选择下拉列表
下一篇:
js判断字符串是否包含某个字符串|JSP 用Excel格式打开网页
相关推荐
【photoshop修改照片尺寸】photoshop修改照片
[column函数]Column count doesn't match value
[ps如何打马赛克的]ps如何打造大雪纷飞
[discuz论坛]discuz URL 静态化
photoshop教程|Photoshop打造梦幻仙境 图片
[选择下拉列表框]选择下拉列表
warning battery is critically low|Warning: mysql_num_rows():
ps日系风格照片|ps风格非主流 教程
css发动机|css常属性
做站选择题|做站选择那方面最好
网友关注
【marquee boost】marquee的用法
如何调用存储过程返回值|如何调用存储过程
手机如何挣钱|网站如何挣钱
非主流签名火星文_非主流男生签名制作
warning battery is critically low_Warning: mssql_query() :
[对联广告图片]对联广告关闭代码
sql server|sql 删除重复记录
【seo优化】SEO优化心得
【非主流浪漫爱情图片】ps制作非主流浪漫爱情图片
phpstudy|php 遍历目录
热门标签
鼠标不能上下滚动
excel不能上下滚动
html上下滚动
最新excel
excel
mysql导入excel表|mysql导入excel方法
excel
【excel长度超过255个字符】EXCEL长度超过255个字符导入SQL SERVER2005的方法
excel
asp.net core_ASP.NET Excel读写文件代码
excel
[phpstudy]php ExcelReader读取excel文件
excel
[asp.net core]asp.net 导出EXCEL文件二种方法
excel
【asp.net core】asp.net ajax下导出excel的解决办法
excel
【asp.net core】asp.net 导出excel与单元格中图片的方法:
excel
【php去除重复数据】php去除重复单词与取得所有链接 正则代码
excel
csrf-token|C#中dataset导出到excel
excel
.net导入excel时获取第一个sheet|.net导入excel时获取第一个Sheet名称
excel热门文章
exce
js判断字符串是否包含某个字符串|JSP 用Excel格式打开网页
exce
html 图片自适应大小_图片自适应大小
exce
[透明文本输入框]透明文本输入框
exce
excel菜单下拉键|下拉透明菜单
exce
简单php生成工具_简单php生成 execel表格 程序
exce
下拉菜单怎么做|下拉菜单
exce
多级下拉菜单怎么做_多级下拉菜单
exce
excel下拉菜单_类qq下拉菜单 代码
exce
【导航下拉菜单代码】导航下拉菜单 代码
exce
[url解码 在线]URl解码
声明:本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
Copyright©2006-2019 编程学习网 www.gdgbn.com 版权所有