cycle through div's? very elementary but... '*?§$%
It's my first steps with jQuery and I can't get my head around it yet completely... here's what I did:
I'm trying to make div's fade In & out. They have all the same class (.info), but depending on which link I clicked I want a specific div to fade in, and all others to fade out. 1. Link activates 1. DIV, 2. Link 2.DIV etc.
the activating links also share a class (<a class="showDiv">);
It works fine, if I fade all the <div class="info"> at once, but I can't seem to get it work with the index-variable [i].
this works, but fades all the divs:
$("a.showDiv").each(function(i) {
$(this).click(function() {
$("div.info").fadeIn(200);
});
});
this is how i would think it should work, but it doesn't
$("a.showDiv").each(function(i) {
$(this).click(function() {
$("div.info")[i].fadeIn(200);
});
});
thank you!