2008-04-18

JavaScript 模拟marquee效果

关键字: javascript, marquee, firefox, ie, 停止、渐变
这段代码主要实现了一个具有渐变滚动效果的marquee,当其获得焦点的时候会出现停顿效果 javascript代码如下: /** *@author anwx <a href="mailto:luckyanzi@china.com.cn">An Weixiao</a> *@version $Id$ */ var m_iInterval; var m_Height; var iScroll=0; var SnowMarquee = function(){} SnowMarquee.prototype = { //其实其应该具有 timeout c ...
2008-04-10

关于setTimeout我来说两句

关键字: settimeout setinterval
关键点: 1、在类中如何使用setTiemout 注意代码中var self = this. 2、使用setTimeout模拟setInterval 3、避免一些错误 如too much recursion 错误的代码尝试 var SnowSetTimeoutTest = function(){ this.count = 0; } SnowSetTimeoutTest.prototype.testIt = function(){ var self = this; alert(this.count++); /** *但 ...