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

📄 togglebutton.js

📁 AJAX 应用 实现页面的无刷新
💻 JS
📖 第 1 页 / 共 2 页
字号:
        } 
    },
    
    _onDecoyElementMouseOut : function(e) {
        /// <summary>
        /// Handle the decoy element's mouseout event
        /// </summary>
        /// <param name="e" type="Sys.UI.DomEvent">
        /// Event info
        /// </param>

        // Call _onClick because it restores the correct image
        this._onClick();
    },        

    get_ImageWidth : function() {
        /// <value type="Number" integer="true">
        /// Width of the image that will be displayed
        /// </value>
        return this._ImageWidth;
    },
    set_ImageWidth : function(value) {
        if (this._ImageWidth != value) {
           this._ImageWidth = value;
           this.raisePropertyChanged('ImageWidth');
        }
    },

    get_ImageHeight : function() {
        /// <value type="Number" integer="true">
        /// Height of the image that will be displayed
        /// </value>
        return this._ImageHeight;
    },
    set_ImageHeight : function(value) {
        if (this._ImageHeight != value) {
            this._ImageHeight = value;
            this.raisePropertyChanged('ImageHeight');
        }
    },

    get_UncheckedImageUrl : function() {
        /// <value type="String">
        /// URL of the image to show when the toggle button is in the unchecked state
        /// </value>
        return this._UncheckedImageUrl;
    },
    set_UncheckedImageUrl : function(value) {
        if (this._UncheckedImageUrl != value) {
            this._UncheckedImageUrl = value;
            this.raisePropertyChanged('UncheckedImageUrl');
        }
    },

    get_CheckedImageUrl : function() {
        /// <value type="String">
        /// URL of the image to show when the toggle button is in the checked state
        /// </value>
        return this._CheckedImageUrl;
    },
    set_CheckedImageUrl : function(value) {
        if (this._CheckedImageUrl != value) {
            this._CheckedImageUrl = value;
            this.raisePropertyChanged('CheckedImageUrl');
        }
    },

    get_DisabledUncheckedImageUrl : function() {
        /// <value type="String">
        /// URL of the image to show when the toggle button is disabled and in the unchecked state
        /// </value>
        return (this._DisabledUncheckedImageUrl != undefined) ?
            this._DisabledUncheckedImageUrl : this._UncheckedImageUrl;
    },
    set_DisabledUncheckedImageUrl : function(value) {
        if (this._DisabledUncheckedImageUrl != value) {
            this._DisabledUncheckedImageUrl = value;
            this.raisePropertyChanged('DisabledUncheckedImageUrl');
        }
    },

    get_DisabledCheckedImageUrl : function() {
        /// <value type="String">
        /// URL of the image to show when the toggle button is disabled and in the checked state
        /// </value>
        return (this._DisabledUncheckedImageUrl != undefined) ?
            this._DisabledCheckedImageUrl : this._CheckedImageUrl;
    },
    set_DisabledCheckedImageUrl : function(value) {
        if (this._DisabledCheckedImageUrl != value) {
            this._DisabledCheckedImageUrl = value;
            this.raisePropertyChanged('DisabledCheckedImageUrl');
        }
    },
    
    get_CheckedImageOverUrl : function() {
        /// <value type="String">
        /// URL of the image to show when the toggle button is in the checked state and the cursor is positioned over the element
        /// </value>
        return this._CheckedImageOverUrl;
    },
    set_CheckedImageOverUrl : function(value) {
        if (this._CheckedImageOverUrl != value) {
            this._CheckedImageOverUrl = value;
            this.raisePropertyChanged('CheckedImageOverUrl');
        }
    },  
    
    get_UncheckedImageOverUrl : function() {
        /// <value type="String">
        /// URL of the image to show when the toggle button is in the unchecked state and the cursor is positioned over the element
        /// </value>
        return this._UncheckedImageOverUrl;
    },
    set_UncheckedImageOverUrl : function(value) {
        if (this._UncheckedImageOverUrl != value) {
            this._UncheckedImageOverUrl = value;
            this.raisePropertyChanged('UncheckedImageOverUrl');
        }
    },        

    get_UncheckedImageAlternateText : function() {
        /// <value type="String">
        /// the alt text to show when the toggle button is in the unchecked state
        /// </value>
        return this._UncheckedImageAlternateText;
    },
    set_UncheckedImageAlternateText : function(value) {
        if (this._UncheckedImageAlternateText != value) {
            this._UncheckedImageAlternateText = value;
            this.raisePropertyChanged('UncheckedImageAlternateText');
        }
    },

    get_CheckedImageAlternateText : function() {
        /// <value type="String">
        /// the alt text to show when the toggle button is in the checked state
        /// </value>
        return this._CheckedImageAlternateText;
    },
    set_CheckedImageAlternateText : function(value) {
        if (this._CheckedImageAlternateText != value) {
            this._CheckedImageAlternateText = value;
            this.raisePropertyChanged('CheckedImageAlternateText');
        }
    },
    
    get_CheckedImageOverAlternateText : function() {
        /// <value type="String">
        /// the alt text to show when the toggle button is in the checked state and the element is moused over
        /// </value>
        return this._CheckedImageOverAlternateText;
    },
    set_CheckedImageOverAlternateText : function(value) {
        if (this._CheckedImageOverAlternateText != value) {
            this._CheckedImageOverAlternateText = value;
            this.raisePropertyChanged('CheckedImageOverAlternateText');
        }
    },
    
    get_UncheckedImageOverAlternateText : function() {
        /// <value type="String">
        /// the alt text to show when the toggle button is in the unchecked state and the element is moused over
        /// </value>
        return this._UncheckedImageOverAlternateText;
    },
    set_UncheckedImageOverAlternateText : function(value) {
        if (this._UncheckedImageOverAlternateText != value) {
            this._UncheckedImageOverAlternateText = value;
            this.raisePropertyChanged('UncheckedImageOverAlternateText');
        }
    }        
}
AjaxControlToolkit.ToggleButtonBehavior.registerClass('AjaxControlToolkit.ToggleButtonBehavior', AjaxControlToolkit.BehaviorBase);
//    getDescriptor : function() {
//        var td = AjaxControlToolkit.ToggleButtonBehavior.callBaseMethod(this, 'getDescriptor');
//        // Add custom properties
//        td.addProperty('ImageWidth', String);
//        td.addProperty('ImageHeight', String);
//        td.addProperty('UncheckedImageUrl', String);
//        td.addProperty('CheckedImageUrl', String);
//        td.addProperty('DisabledUncheckedImageUrl', String);
//        td.addProperty('DisabledCheckedImageUrl', String);
//        td.addProperty('CheckedImageOverUrl', String);
//        td.addProperty('UncheckedImageOverUrl', String);
//        td.addProperty('UncheckedImageAlternateText', String);
//        td.addProperty('CheckedImageAlternateText', String);
//        td.addProperty('CheckedImageOverAlternateText', String);
//        td.addProperty('UncheckedImageOverAlternateText', String);
//        return td;
//    },

⌨️ 快捷键说明

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