$(document).ready(main); var contador = 1; var instrumentos = 1; var atelier = 1; var services = 1; function ShowMenu(){ if(contador == 1){ $('.list_mobile').animate({ left: '0' }); contador = 0; } } function HideMenu(){ if(contador == 0){ contador = 1; $('.list_mobile').animate({ left: '-100%' }); } } function main(){ $('#Mobile-Menu').click(function(){ if(contador == 1){ $('.list_mobile').animate({ left: '0' }); contador = 0; } else { contador = 1; $('.list_mobile').animate({ left: '-100%' }); } }); $('#Instruments_Bows').click(function(){ if(instrumentos == 1){ $('#Instruments_Bows').addClass('active_'); $('#Instruments_Bows_subMenu').animate({ left: '0' }); instrumentos = 0; } else { $('#Instruments_Bows').removeClass('active_'); instrumentos = 1; $('#Instruments_Bows_subMenu').animate({ left: '-100%' }); } }); $('#Atelier').click(function(){ if(atelier == 1){ $('#Atelier').addClass('active_'); $('#Atelier_subMenu').animate({ left: '0' }); atelier = 0; } else { $('#Atelier').removeClass('active_'); atelier = 1; $('#Atelier_subMenu').animate({ left: '-100%' }); } }); $('#Services').click(function(){ $('#Services').addClass('active_'); if(services == 1){ $('#Services_subMenu').animate({ left: '0' }); services = 0; } else { $('#Services').removeClass('active_'); services = 1; $('#Services_subMenu').animate({ left: '-100%' }); } }); } $('#toggle-login').on('click', function(evt) { $('#login').toggle(); }); $('#toggle-account').on('click', function(evt) { $('#account').toggle(); }); $('#toggle-lang').on('click', function(evt) { $('#lang').toggle(); }); $(document).ready(function() { var id = '#dialog'; //Get the screen height and width var maskHeight = $(document).height(); var maskWidth = $(window).width(); //Set heigth and width to mask to fill up the whole screen $('#mask').css({'width':maskWidth,'height':maskHeight}); //transition effect $('#mask').fadeIn(500); $('#mask').fadeTo("slow",0.9); //Get the window height and width var winH = $(window).height(); var winW = $(window).width(); //Set the popup window to center $(id).css('top', winH/2-$(id).height()/2-50); $(id).css('left', winW/2-$(id).width()/2-50); //transition effect $(id).fadeIn(2000); //if close button is clicked $('.window .close').click(function (e) { //Cancel the link behavior e.preventDefault(); $('#mask').hide(); $('.window').hide(); }); //if mask is clicked $('#mask').click(function () { $(this).hide(); $('.window').hide(); }); });