I'm making a site where I count the .jpgs in the img folder and save the number under albumLength, then use a for cycle to display them all on the site, and each of them has an id ="content"+i, so content1, content2,etc. When I hover over content1 I want the element with id= plus_label1 to stop being hidden and make it visible and when I leave the object to make it invisible again. The problem is that my current code isn't working, no errors, it just doesn't appear. Any ideas why?
for(i=1;i<=albumLength;i++){
$("#content"+i ).hover(
function() {
$("#plus_label"+i).css('visibility','visible');
},
function() {
$("#plus_label"+i ).css( 'visibility','hidden');
}
);
}