⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 marquee.js

📁 通达网络办公 - Office Anywhere 2008 增强版100%源码(3.4.081216) 内含 通达OA2008增強版接近完美破解补丁20081216集 及 最新通达OA2008ADV(
💻 JS
字号:
// marquee box// Array prototype ,for IE 5if (!Array.prototype.push){    Array.prototype.push = function (Item){        this[this.length] = Item;        return this.length;    };}marquee = function(Name){    // default    this.Speed = 60;        // scroll speed    this.Delay = 20*1000;      // 60000 delay timeout  单个显示时间,毫秒    this.Rows = 1;          // rows of keep    this.Cols = 1;          // cols of keep    this.Height = 14;       // height of block    this.Width = '100%';       // width of block    this.Direct = 'up';     // up,down,left,right    this.Id = 0;    this.Name = Name;       // marquee box name,ascii    this.Content = new Array();    this.DelayInterval = null;    this.ScrollInterval = null;    eval('window.' + this.Name + '= this;');};// internal functionmarquee.prototype.getObj = function(objId){    if(navigator.appName!='Microsoft Internet Explorer'){        return document.getElementById(objId);    }else{        try{            return document.all[objId];        }catch(e){return null;}    }};// drawingmarquee.prototype.init = function(content){    this.Content = content;    document.write('<div id="' + this.Name + '" style="overflow:hidden;height:' + this.Rows * this.Height + 'px;width:' + this.Cols * this.Width + 'px;">');    document.write('<div style="overflow:hidden;height:' + this.Height + 'px;width:' + this.Width + 'px;">' + this.Content[this.Id] + '</div></div>');    this.getObj(this.Name).onmouseover = function(){        if (this.id != ''){            var Obj = eval('window.' + this.id);            clearInterval(Obj.DelayInterval);        }    };    this.getObj(this.Name).onmouseout = function(){        if (this.id != ''){            var Obj = eval('window.' + this.id);            Obj.DelayInterval = setInterval(Obj.Name + ".start()",Obj.Delay);        }    };    this.DelayInterval = setInterval(this.Name + ".start()",this.Delay);};marquee.prototype.start = function(){    var marqueeBox = this.getObj(this.Name);    this.Id++;    if(this.Id > this.Content.length - 1) this.Id = 0;    if(marqueeBox.childNodes.length <= this.Rows) {        var nextLine = document.createElement('DIV');        nextLine.style.overflow = 'hidden';        nextLine.style.height = this.Height;        nextLine.style.width = this.Width;        nextLine.innerHTML = this.Content[this.Id];        marqueeBox.appendChild(nextLine);    } else {        marqueeBox.childNodes[0].innerHTML = this.Content[this.Id];        marqueeBox.appendChild(marqueeBox.childNodes[0]);        marqueeBox.scrollTop = 0;    }    clearInterval(this.ScrollInterval);    this.ScrollInterval = setInterval(this.Name + ".scroll()",this.Speed);};marquee.prototype.scroll = function(){    this.getObj(this.Name).scrollTop++;    if(this.getObj(this.Name).scrollTop % this.Height == (this.Height - 1)){        clearInterval(this.ScrollInterval);    }};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -