Created
January 21, 2016 12:27
-
-
Save permatis/3b57c1ef8ffd0f1ed73c to your computer and use it in GitHub Desktop.
How to resolve problems when you declare a variable in a function or jquery plugin too much.
This file contains 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
/** | |
* As an example, I use jquery plugins Chosen. | |
*/ | |
$('#firstid').chosen({}); | |
$('#secondid').chosen({}); | |
$('#moreid').chosen({}); | |
/** | |
* How to resolve : Get id attribute from tag select. | |
*/ | |
$('select').each( function(i,v) { | |
$('#'+$(this).attr('id')).chosen({ width: '100%' }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment