I have several elements with class name "hidden" that basically sets display to none. I'm trying to create a function using jquery that when I click on a button every element with that class name should become visible one at a time and preferably with some animation.
I tried the following
$('btn1').click(function() {
$('.hide').each(function(index) {
$(this).toggle();
});
});
This works but everything shows at the same time. Since I would like it one at a time I tried doing the following
$('btn1').click(function() {
$('.hide').each(function(index) {
setTimeOut(function() {
$(this).toggle();
},1500);
});
});
This gives me an error an TypeError 'cannot read property Display.....' I'm guessing it is because I'm inside another function and the $(this) does not reference the element that I want. How can I pass the element to the SetTimeOut function?
Any help would be greatly appreciated
Thanks
CES