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

推荐订阅源

博客园 - 叶小钗
V
Visual Studio Blog
雷峰网
雷峰网
J
Java Code Geeks
博客园 - 三生石上(FineUI控件)
人人都是产品经理
人人都是产品经理
MyScale Blog
MyScale Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
B
Blog RSS Feed
C
Check Point Blog
博客园 - Franky
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - 【当耐特】
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
V
V2EX
D
Docker
IT之家
IT之家
博客园 - 聂微东
腾讯CDC
U
Unit 42
Microsoft Security Blog
Microsoft Security Blog
The Cloudflare Blog

博客园 - 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 用ajax.net封装的不间断marquee行为 http://shanghai.myol.cn/ favicon.ico图标在线制作+ico下载 验证码 转贴 lightbox
新封装的仿kijiji的城市菜单
jueban's space · 2008-03-13 · via 博客园 - jueban's space

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

Type.registerNamespace(
"DDT");

DDT.CityButton 

= function(element) {
    DDT.CityButton.initializeBase(
this, [element]);
    
this.cityDiv;
}

DDT.CityButton.prototype 

= {
    initialize: 
function() {
        DDT.CityButton.callBaseMethod(
this'initialize');
        
this._onMouseOverHandler = Function.createDelegate(this,this._onMouseOver);
        
this._onMouseOutHandler = Function.createDelegate(this,this._onMouseOut);
        $addHandler(
this.get_element(), "mouseover",this._onMouseOverHandler);
        $addHandler(
this.get_element(), "mouseout",this._onMouseOutHandler);   
        $addHandler(
this.cityDiv, "mouseout",this._onMouseOutHandler);  
        $addHandler(
this.cityDiv, "mouseover",this._onMouseOverHandler);   
    },
    get_cityDiv : 
function() {return this.cityDiv;},
    set_cityDiv : 
function(value) {  
        
if (this.cityDiv != value) {   
                
this.cityDiv = value;
                
this.raisePropertyChanged("cityDiv");
            }
    },
    _onMouseOver:
function(){
        
var Bounds = Sys.UI.DomElement.getBounds(this.get_element());
        
var x = Bounds.x;
        
var y = Bounds.height+Bounds.y;
        Sys.UI.DomElement.setLocation(
this.cityDiv,x,y);
        Sys.UI.DomElement.setVisible(
this.cityDiv,true);
    },
    _onMouseOut:
function(){
        Sys.UI.DomElement.setVisible(
this.cityDiv,false);
    },
    dispose: 
function() {        
        
//Add custom dispose actions here
        DDT.CityButton.callBaseMethod(this'dispose');
    }
}
DDT.CityButton.registerClass(
'DDT.CityButton', Sys.UI.Behavior);if (typeof(Sys) !== 'undefined') Sys.Application.notifyScriptLoaded();

使用方法:

      $create(DDT.CityButton,{"cityDiv":$get("Layer1")},null,null,$get("btn"));