Hey I have 10 ten image in a div(name is background).. and display properties is none..
I want to show by questions number.. I mean Question=1 img1.hide(),img2.show() Question=2 img2.hide(); img3.show ………… question 10 img9.hide() img10.show
my function name is resim() and it callback from Button click
function resim(question) This is wrong right 🙂 Actually this is wrong.. it doesn’t work :))
var i=0;
while (i<3)
{
if (question==i)
{
$("#background img").eq(i-1).hide();
$("#background img").eq(i).show();
i++;
}
else
{
return;
}
}
but I cant do the function… How must it be? Sorry about my english
If the
div#backgroundcontains all yourimgtags anddiv#backgroundis set todisplay:none;then even if you set the images to show, they won’t display because their parent element is set not to display.You’ll have to set the
div#backgroundto show and the individualimgtags to hide and show the individual images as needed.An alternate function you may want use could look like this: