Created
January 23, 2015 05:19
-
-
Save anthonyvscode/b04f1b92d64e37ef4afe to your computer and use it in GitHub Desktop.
Initialize Ladda Bootstrap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
this.initLadda = function() { | |
var selector = "input[type=submit]"; | |
$(selector) | |
.attr("data-style", "zoom-in") | |
.each(function () { | |
var element = $(this); | |
if (element.hasClass('btn-xs')) { | |
element.attr("data-size", "xs"); | |
} | |
if (element.hasClass('btn-sm')) { | |
element.attr("data-size", "s"); | |
} | |
if (element.hasClass('btn-lg')) { | |
element.attr("data-size", "l"); | |
} | |
//Button Color | |
if (element.hasClass("btn-default")) { | |
element.attr("data-spinner-color", "#000"); | |
} else { | |
element.attr("data-spinner-color", "#fff"); | |
} | |
}); | |
Ladda.bind(selector); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment