Variables in :eq() [Solved]
-
$(document).ready(function() {
$('div.infoContent:gt(0)').hide();
$('.show').click(function(){
var thisid = this.id;
$('div.infoContent:eq(thisid)').toggle('slow');
$('div.infoContent:gt(thisid)').hide('slow');
$('div.infoContent:lt(thisid)').hide('slow');
});
});
There's something wrong with me using 'thisid' in with :eq().
I have tried just putting a static number instead of the variable, and it gives me the desired effect (but with only one element instead of a selected element).
Am I doing something wrong? I tried putting quotes around thisid so it would read $('div.infoContent:eq('thisid')').toggle('slow'); , but that didn't work at all and nothing worked.
Any help would be much appreciated. I don't think the HTML to go with it is necessary, I think I'm just messing up the syntax or not using the variable the right way.
Thanks in advance.
Oh.....thisid returns an integer value.