惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
腾讯CDC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
F
Full Disclosure
博客园 - 【当耐特】
C
CERT Recently Published Vulnerability Notes
Engineering at Meta
Engineering at Meta
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Threatpost
I
Intezer
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
小众软件
小众软件
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
N
News | PayPal Newsroom
MyScale Blog
MyScale Blog
AI
AI
Vercel News
Vercel News
Spread Privacy
Spread Privacy
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
U
Unit 42
L
LangChain Blog
Recent Announcements
Recent Announcements

博客园 - jueban's space

js - jueban's space - 博客园 确定删除 - jueban's space - 博客园 SQL语句大全 上海 招聘 asp.net jq 的程序员 上海 招聘 asp.net jq 程序员 sql2005 asp.net2.0安全性(1)--用户角色篇(类) 常用编码工具类,支持base64,md5,des,crc32 reg 新城管如何变老城管 进度条 xss tt 可拖动,ModalPopup 新封装的仿kijiji的城市菜单 http://shanghai.myol.cn/ favicon.ico图标在线制作+ico下载 验证码 转贴 lightbox
用ajax.net封装的不间断marquee行为
jueban's space · 2008-03-13 · via 博客园 - jueban's space

/// <reference name="MicrosoftAjax.js"/>

Type.registerNamespace(
"DDT");
DDT.Direction 
= function(){};
DDT.Direction.prototype 
= {
        Left:
0,
        Right:
1,
        Up:
2,
        Down:
3
    } 
DDT.Direction.registerEnum(
"DDT.Direction");
DDT.Marqee 
= function(element) {
    DDT.Marqee.initializeBase(
this, [element]);    
    
this.EnumDirection  = DDT.Direction.Left;
    
this.Speed = 30;
    
this.TimeId = null;
}

DDT.Marqee.prototype 

= {
    initialize: 
function() {
        DDT.Marqee.callBaseMethod(
this'initialize');        
        
this.get_element().innerHTML += this.get_element().innerHTML;
        
this.get_element().style.overflow = "hidden";
        
if(this.EnumDirection==DDT.Direction.Left||this.EnumDirection==DDT.Direction.Right)
        {
            
this.get_element().style.whiteSpace="nowrap";            
        }
        
this._onMouseOverHandler = Function.createDelegate(this,this._onMouseOver);
        
this._onMouseOutHandler = Function.createDelegate(this,this._onMouseOut);
        
this._onMarqeeHandler = Function.createDelegate(this,this._onMarqee);
        $addHandler(
this.get_element(), "mouseover",this._onMouseOverHandler);
        $addHandler(
this.get_element(), "mouseout",this._onMouseOutHandler);
        
this.TimeId = setInterval(this._onMarqeeHandler,this.Speed);
        
// Add custom initialization here
    },_onMarqee:function(){
        
switch(this.EnumDirection)
        {
            
case DDT.Direction.Right:
                
if(this.get_element().scrollLeft<=0){                     
                    
this.get_element().scrollLeft = this.get_element().scrollWidth/2;                    
                }else{
                    
this.get_element().scrollLeft --;
                }
            
break;
            
case DDT.Direction.Up:
                
if(this.get_element().scrollTop>=(this.get_element().scrollHeight) /2){            
                    this.get_element().scrollTop = 0;
                }
else{
                    
this.get_element().scrollTop ++;
                }
            
break;
            
case DDT.Direction.Down:
                
if(this.get_element().scrollTop<=0){                               
                    
this.get_element().scrollTop = (this.get_element().scrollHeight) /2;
                }else{
                    
this.get_element().scrollTop --;
                }
            
break;
            
default:
                
if(this.get_element().scrollLeft>=this.get_element().scrollWidth/2){            
                    this.get_element().scrollLeft = 0;
                }
else{
                    
this.get_element().scrollLeft ++;
                }
            
break;
            
        }
        
    },_onMouseOver:
function(){
        clearInterval(
this.TimeId);        
    },_onMouseOut:
function(){
        
this.TimeId = setInterval(this._onMarqeeHandler,this.Speed);
    },
    dispose: 
function() {        
        
//Add custom dispose actions here
        DDT.Marqee.callBaseMethod(this'dispose');
    }
}
DDT.Marqee.registerClass(
'DDT.Marqee', Sys.UI.Behavior);if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();

使用方法:

      $create(DDT.Marqee,{Speed:30,EnumDirection:DDT.Direction.Right},null,null,$get("UserScoreScroll"));