I’m a Jeopardy game and I’m using the FancyBox lightbox plugin to show all the questions in.
I’m trying to create a bonus question. This question is supposed to pop up once all of the 25 spots are gone. I’m currently using a large if statement:
if($('#html5_100').is(':hidden') &&$('#html5_200').is(':hidden') &&$('#html5_300').is(':hidden') &&$('#html5_400').is(':hidden') &&$('#html5_500').is(':hidden') &&$('#attr_100').is(':hidden') &&$('#attr_200').is(':hidden') &&$('#attr_300').is(':hidden') &&$('#attr_400').is(':hidden') &&$('#attr_500').is(':hidden') &&$('#tf_100').is(':hidden') &&$('#tf_200').is(':hidden') &&$('#tf_300').is(':hidden') &&$('#tf_400').is(':hidden') &&$('#tf_500').is(':hidden') &&$('#dtag_100').is(':hidden') &&$('#dtag_200').is(':hidden') &&$('#dtag_300').is(':hidden') &&$('#dtag_400').is(':hidden') &&$('#dtag_500').is(':hidden') &&$('#tag_100').is(':hidden') &&$('#tag_200').is(':hidden') &&$('#tag_300').is(':hidden') &&$('#tag_400').is(':hidden') &&$('#tag_500').is(':hidden')){
$('#bonus').fancybox({
'transitionIn' : 'elastic',
'transitionOut' : 'elastic',
'hideOnOverlayClick':false,
'hideOnContentClick':false,
'showCloseButton' : false,
'overlayOpacity' : 1
}).click();
}
And I’m trying to use $('#ID').is(':hidden');
I put 25 of these ifs in each Click function for each button. The problem is that once I click submit it opens this fancybox. Is there a way to stop this?
If you need more help understanding I could upload my game and just give you a link to it.
does
&&$('#html5_200').is(':hidden')is like that in your code? you need to change all those “&&$” it to&& $('#html5_200').is(':hidden')(add space between && and $() ),edit:
whay did you added the
.click()after the call to$('#bonus').fancybox{ ... }? try to remove this from your code because i thik the call to the .click() function trigger this. if it doesn’t help either, i will have to see the rest of your code to figure it out