toggle boxes
toggle boxes
Hey there.. Well I'm not that good @ jQuery.. I started with it about 10h ago.. So here's my little code:
-
$num = "1";
while($num<=2){
echo "<a href='#' id='showcode'>Show code</a>";
echo "<div id='codebox'><textarea rows='2' cols='52' readonly='readonly'/>".$num"</textarea></div>";
}
It displays 2 items.. But now I have this code:
-
$(function(){
$('a[id=showcode]').click(function(){
$('#codebox').toggle(1500);
});
});
So here's my question.. When I click on "Show code" that's below the first "Show code" then it toggles this first "Show code" and it only shows one "Show code" and this means it don't show my second "Show code" textarea.. I really don't have no idea how to fix it.. So maybe you can help you..
Little image here that will help you if you didn't understand what I said
Regards,
Jaan[/code]