I have a menu with some links which hides/shows div pages.
On the first page I have youtube video playing, but if I click another link, the video dissapears as another div will be showing, but the video keeps playing..
I found the way of how to stop the video etc, but while debugging, I can not seem to make my alert to go off while I write this:
if ( $("#main").css('display') == 'none')
{
alert("Hello! I am an alert box!!");
}
If I were to change none to block the alert box will appear once the page loads up. So how come it does not show up once the id for main changes to none (when I click another menu link)?
EDITED:
Thats how I set the attributes to none with the menu links:
$('.tabs a').on( "click", function(e) {
e.preventDefault();
var id = $(this).attr('data-related');
$(".frame div").each(function(){
$(this).hide();
if($(this).attr('id') == id) {
$(this).show();
}
});
});