Skip to content

Instantly share code, notes, and snippets.

@konamax123 konamax123/commentForm
Last active Aug 29, 2015

Embed
What would you like to do?
Trying to slidetoggle a comment form.
$(document).ready(function(){
CommentFormRevealer.bindEvents();
});
CommentFormRevealer = {
bindEvents: function(){
// console.log("I'm in bindEvents");
$('.dropdown-toggle').hide(); // This will not be hidden the first time around but when the page is refreshed it will.
$('.see-form').on('click', this.commentForm);
},
commentForm: function(){
event.preventDefault();
console.log("I'm in commentForm"); //This function will not be executed when I navigate to this page the first time.
// But if I reload it it will
$(this).next('.dropdown-toggle').slideToggle();
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.