Skip to content

Instantly share code, notes, and snippets.

@puiutucutu
Created October 13, 2015 20:02
Show Gist options
  • Save puiutucutu/940091350f7b69442581 to your computer and use it in GitHub Desktop.
Save puiutucutu/940091350f7b69442581 to your computer and use it in GitHub Desktop.
jquery iife
(function ($) {
'use strict';
var dismiss = '[data-dismiss="alert"]'
var Alert = function (el) {
$(el).on('click', dismiss, this.close)
var $parent = $(this).closest('.alert')
$parent.removeClass('in')
}
$(document).on('click', dismiss, Alert)
})(jQuery);
@puiutucutu
Copy link
Author

(function ($) {
        'use strict';

        // set target
        var dismiss = '[data-dismiss="alert"]'

        var Alert = function () {
            // get parent
            var parent = $(this).closest('.alert')

            // remove a class
            parent.removeClass('in')            
        }

        $(document).on('click', dismiss, Alert)

     })(jQuery);










(function ($) {
    var dismiss = '[data-dismiss="alert"]' 

    var Alert = function () {
        var parent = $(this).closest('.alert') 
        var parentId = $(this).parent().attr('id'); 
        toggleBootstrapHidden('#' + parentId, 'hide')       
    }

    $(document).on('click', dismiss, Alert)

})(jQuery);



@puiutucutu
Copy link
Author

        selectmenuWidgetId.find('option').length > 0 ? selectmenuWidgetId.selectmenu('refresh')
                                                     : selectmenuWidgetId.selectmenu('disable');

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment