Created
August 17, 2016 05:15
-
-
Save shanimal/d975416e6e85116bd2a90a43d2401d6a to your computer and use it in GitHub Desktop.
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
$('#myParentElement').one('click','a.myClass',function(){ | |
/* this code will execute only once */ | |
$('#myParentElement a.myClass').editable().click(); | |
}); |
This is the code:
$('#myParentElement').one('click','a.myClass',function(){ /* this code will execute only once */ $('#myParentElement a.myClass.editable').removeClass('editable').editable(); });
You don't need to add the editable class, .one
will only happen once anyway.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We are also adding a class to element we are applying plugin and before applying plugin we are remove that class.