105
rated 0 times
[
108]
[
3]
/ answers: 1 / hits: 21635
/ 9 Years ago, wed, july 29, 2015, 12:00:00
I trying to Execute given .click(function()
only on first click, but it always Execute when click.
It's works when click .more-post-button
it will add class loading
to .main ul
and show-more-post
to .main li
after that remove Class loading
on setTimeout function 7 second.
JS:
$(.more-post-button).click(function () {
$('.main ul').addClass('loading');
$('.main li').addClass('show-more-post');
setTimeout(function(){
$('.main ul').removeClass('loading');
},7000);
});
My question is how to do this for only on first click, not every time click.
Thanks in advance.
More From » jquery