$.fn.wait = function(time, type) { time = time || 1000; type = type || "fx"; return this.queue(type, function() { var self = this; setTimeout(function() { $(self).dequeue(); }, time); }); }; $(document).ready(function(){ $('a[rel=foto]').fancybox({ 'titleShow' : false }); $('a[rel=fotodetale]').fancybox({ 'titleShow' : false }); $('#img1').animate({opacity:'0.6'}, 0); $('#img2').animate({opacity:'0.6'}, 0); $('#img3').animate({opacity:'0.6'}, 0); $('#img4').animate({opacity:'0.6'}, 0); $('#up_g').hover(function(){ $(this).animate({opacity:'1'}, 310);} , function(){ $(this).animate({opacity:'0.9'}, 310); }); $('#down_g').hover(function(){ $(this).animate({opacity:'1'}, 310);} , function(){ $(this).animate({opacity:'0.9'}, 310); }); $('#img1').hover(function(){ $(this).animate({opacity:'1'}, 310);} , function(){ $(this).animate({opacity:'0.8'}, 310); }); $('#img2').hover(function(){ $(this).animate({opacity:'1'}, 310);} , function(){ $(this).animate({opacity:'0.8'}, 310); }); $('#img3').hover(function(){ $(this).animate({opacity:'1'}, 310);} , function(){ $(this).animate({opacity:'0.8'}, 310); }); $('#img4').hover(function(){ $(this).animate({opacity:'1'}, 310);} , function(){ $(this).animate({opacity:'0.8'}, 310); }); $('#up_g').click(function(){ $('#klawisze').animate({opacity:'0.0'}, 310).wait(600); list1(); }); $('#down_g').click(function(){ $('#klawisze').animate({opacity:'0.0'}, 310).wait(600); list2(); }); $('#img1').click(function(){open1(); }); $('#img2').click(function(){open2(); }); $('#img3').click(function(){open3(); }); $('#img4').click(function(){open4(); }); }); function list1() { $.ajax({ type: 'POST', cache: false, url: 'https://piece-nagrzewnice.pl/SKLEP/pro/tgalery.php', data: 'idd=92'+ '&dimg=DIMG'+ '&dhome=https://piece-nagrzewnice.pl/'+ '&dimghome=https://piece-nagrzewnice.pl/image/'+ '&dipanel='+ '&licznik='+$('#img1').attr('title')+ '&tryb=up' , global: true, dataType: 'json', success: function(dataz){ var nn1=jQuery.parseJSON(dataz); $('#zlist').animate({opacity:'0.5'}, 510); $('#img1').animate({marginLeft:'130px'}, 0); $('#img1').attr("src", nn1.img1); $('#img1').attr("title", nn1.title1); $('#img2').attr("src", nn1.img2); $('#img2').attr("title", nn1.title2); $('#img3').attr("src", nn1.img3); $('#img3').attr("title", nn1.title3); $('#img4').attr("src", nn1.img4); $('#img4').attr("title", nn1.title4); $('#img1').animate({marginLeft:'2px'}, 430).wait(30); $('#zlist').animate({opacity:'1'}, 310); $('#klawisze').animate({opacity:'1'}, 330); }, error: function (xhr, ajaxOptions, thrownError){ alert(xhr.status); alert(thrownError); } }); } function list2() { $.ajax({ type: 'POST', cache: false, url: 'https://piece-nagrzewnice.pl/SKLEP/pro/tgalery.php', data: 'idd=92'+ '&dimg=DIMG'+ '&dhome=https://piece-nagrzewnice.pl/'+ '&dimghome=https://piece-nagrzewnice.pl/image/'+ '&dipanel='+ '&licznik='+$('#img1').attr('title')+ '&tryb=down' , global: true, dataType: 'json', success: function(dataz){ var nn1=jQuery.parseJSON(dataz); $('#zlist').animate({opacity:'0.5'}, 510); $('#img1').animate({marginLeft:'-126px'}, 0); $('#img1').attr("src", nn1.img1); $('#img1').attr("title", nn1.title1); $('#img2').attr("src", nn1.img2); $('#img2').attr("title", nn1.title2); $('#img3').attr("src", nn1.img3); $('#img3').attr("title", nn1.title3); $('#img4').attr("src", nn1.img4); $('#img4').attr("title", nn1.title4); $('#img1').animate({marginLeft:'2px'}, 430).wait(30); $('#zlist').animate({opacity:'1'}, 310); $('#klawisze').animate({opacity:'1'}, 330); }, error: function (xhr, ajaxOptions, thrownError){ alert(xhr.status); alert(thrownError); } }); } function open1() { $.ajax({ type: 'POST', cache: false, url: 'https://piece-nagrzewnice.pl/SKLEP/pro/tgalery.php', data: 'idd=92'+ '&dimg=DIMG'+ '&dhome=https://piece-nagrzewnice.pl/'+ '&dimghome=https://piece-nagrzewnice.pl/image/'+ '&dipanel='+ '&licznik='+$('#img1').attr('title') , global: true, dataType: 'json', success: function(dataz){ var nn=jQuery.parseJSON(dataz); $('#kfoto').html(nn.zglobal); $('#openfull').attr('href', nn.full); }, error: function (xhr, ajaxOptions, thrownError){ alert(xhr.status); alert(thrownError); } }); } function open2() { $.ajax({ type: 'POST', cache: false, url: 'https://piece-nagrzewnice.pl/SKLEP/pro/tgalery.php', data: 'idd=92'+ '&dimg=DIMG'+ '&dhome=https://piece-nagrzewnice.pl/'+ '&dimghome=https://piece-nagrzewnice.pl/image/'+ '&dipanel='+ '&licznik='+$('#img2').attr('title') , global: true, dataType: 'json', success: function(dataz){ var nn=jQuery.parseJSON(dataz); $('#kfoto').html(nn.zglobal); $('#openfull').attr('href', nn.full); }, error: function (xhr, ajaxOptions, thrownError){ alert(xhr.status); alert(thrownError); } }); } function open3() { $.ajax({ type: 'POST', cache: false, url: 'https://piece-nagrzewnice.pl/SKLEP/pro/tgalery.php', data: 'idd=92'+ '&dimg=DIMG'+ '&dhome=https://piece-nagrzewnice.pl/'+ '&dimghome=https://piece-nagrzewnice.pl/image/'+ '&dipanel='+ '&licznik='+$('#img3').attr('title') , global: true, dataType: 'json', success: function(dataz){ var nn=jQuery.parseJSON(dataz); $('#kfoto').html(nn.zglobal); $('#openfull').attr('href', nn.full); }, error: function (xhr, ajaxOptions, thrownError){ alert(xhr.status); alert(thrownError); } }); } function open4() { $.ajax({ type: 'POST', cache: false, url: 'https://piece-nagrzewnice.pl/SKLEP/pro/tgalery.php', data: 'idd=92'+ '&dimg=DIMG'+ '&dhome=https://piece-nagrzewnice.pl/'+ '&dimghome=https://piece-nagrzewnice.pl/image/'+ '&dipanel='+ '&licznik='+$('#img4').attr('title') , global: true, dataType: 'json', success: function(dataz){ var nn=jQuery.parseJSON(dataz); $('#kfoto').html(nn.zglobal); $('#openfull').attr('href', nn.full); }, error: function (xhr, ajaxOptions, thrownError){ alert(xhr.status); alert(thrownError); } }); }