src/main/webapp/resources/assets2/js/button/progressbutton.jquery.js

(开头部分) 5KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

/*
* jQuery Progress Button 1.0.0
* https://github.com/Desertsnowman/jQuery-Progress-Buttons
*
* Copyright 2012, David Cramer
* http://digilab.co.za
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/


(function( $ ){

    var methods = {
        init : function( options ) {
            
            // setup the defaults
            // also checks if there are any settings in the data attribute            
            var options = $.extend( {
                'percent'         : false,
                'color'           : false,
                'opacity'         : false,
                'fade'            : false
            }, options);
            var defaults = {
                'percent'         : this.data('percent') ? this.data('percent') : 0,
                'color'           : this.data('color') ? this.data('color') : '#06adff',
                'opacity'         : this.data('opacity') ? this.data('opacity') : 0.09,
                'fade'            : this.data('fade') ? this.data('fade') : 0
            };      
            var settings = {
                'percent'         : options.percent ? this.data('percent', options.percent).data('percent') : defaults.percent,
                'color'           : options.color ? this.data('color', options.color).data('color') : defaults.color,
                'opacity'         : options.opacity ? this.data('opacity', options.opacity).data('opacity') : defaults.opacity,
                'fade'            : options.fade ? this.data('fade', options.fade).data('fade') : defaults.fade
            };
            return this.each(function() {                
                
                var itm = jQuery(this);
                // captures the current background gradien to prepend to the
                // progress gradient
                if(!itm.data('cgrad')){
                    itm.data('cgrad', itm.css('background-image'));
                }
                if(settings.percent > 0){
                    
                    // breakup colour code to rgba so that the start and end can
                    // be set along with adding an opacity
                    r = settings.color.replace(/^s*#|s*$/g, '');
                    if(r.length == 3){
                        r = r.replace(/(.)/g, '$1$1');
                    }                
                    g = parseInt(r.substr(2, 2), 16);
                    b = parseInt(r.substr(4, 2), 16);
                    r = parseInt(r.substr(0, 2), 16);                
                    var rgba = {
                        start : 'rgba(' + r + ', ' + g + ', ' + b + ', ' + settings.opacity + ')',
                        end : 'rgba(' + r + ', ' + g + ', ' + b + ', 0)'
                    };
后面还有 50 行代码,购买后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。