// pouze 1x $('#shop5_slider').remove(); document.write('
'); anim = new Array(); anim[0]='slide1'; anim_set_size(); function anim_set_size() { $('#shop5_slider').replaceWith('
'); var slider_sirka = $('#shop5_slider').width(); var slider_vyska = $('#shop5_slider').width()/965*360; // pokud je nastaveno float if (slider_sirka <= 1) { slider_sirka = 965; slider_vyska = 360; } //alert(slider_sirka+"x"+slider_vyska); $('#shop5_slider').width(slider_sirka); $('#shop5_slider').height(slider_vyska); $("#shop5_slider").append('
'); $("#shop5_slider").append('
'); $("#shop5_slider").append('
'); $("#shop5_slider").append('
'); $("#shop5_slider").append('
'); $("#shop5_slider_anim2").html(anim[0]); $("#shop5_slider_anim1").html(anim[0]); $('a.shop5_slider_img').width(slider_sirka); $('a.shop5_slider_img').height(slider_vyska); $('a.shop5_slider_img img').width(slider_sirka); $('a.shop5_slider_img img').height(slider_vyska); } function anim_change_size() { var puvodni_html = $('#shop5_slider').html(); $('#shop5_slider').replaceWith('
'); var slider_sirka = $('#shop5_slider').width(); var slider_vyska = $('#shop5_slider').width()/965*360; // pokud je nastaveno float if (slider_sirka <= 1) { slider_sirka = 965; slider_vyska = 360; } $('#shop5_slider').html(puvodni_html); $('#shop5_slider').width(slider_sirka); $('#shop5_slider').height(slider_vyska); $('a.shop5_slider_img').width(slider_sirka); $('a.shop5_slider_img').height(slider_vyska); $('a.shop5_slider_img img').width(slider_sirka); $('a.shop5_slider_img img').height(slider_vyska); } anim_poradi = 0; function anim_hlavicka() { x1 = anim_poradi; x2 = anim_poradi+1 if (x2 > anim.length-1) x2 = 0; f1 = anim[x1]; f2 = anim[x2]; anim_poradi++; if (anim_poradi > anim.length-1) anim_poradi = 0; f3 = $("#shop5_slider_anim1").html(); if (f3 == "") f3 = f1; $("#shop5_slider_anim2").html(f3); $("#shop5_slider_anim1").html(f2); var slider_sirka = $('#shop5_slider').width(); var slider_vyska = $('#shop5_slider').width()/965*360; // pokud je nastaveno float if (slider_sirka <= 1) { slider_sirka = 965; slider_vyska = 360; } $('a.shop5_slider_img').width(slider_sirka); $('a.shop5_slider_img').height(slider_vyska); $('a.shop5_slider_img img').width(slider_sirka); $('a.shop5_slider_img img').height(slider_vyska); $("#shop5_slider_anim2").css('opacity',1); $("#shop5_slider_anim1").css('opacity',1); $("#shop5_slider_anim2").animate( {opacity: 0}, 500 , function() { var a1 = $("#shop5_slider_anim1").html(); $("#shop5_slider_anim2").html( a1 ); } ); anim_navig(); } function anim_navig(step) { var por = ""; for(var i=0; i'; por += " "+(i+1)+" "; } else { por += ''; por += " "+(i+1)+" "; } por += ''; } $("#shop5_slider_poradi").html(por); $('#shop5_slider_left').html('LEFT'); $('#shop5_slider_right').html('RIGHT'); } function anim_step(step) { if (step<0) step = anim.length-1; clearInterval(anim_interval); anim_interval = setInterval("anim_hlavicka();", 5000); $("#shop5_slider_anim2").stop(); anim_poradi = step-1; anim_hlavicka(); } anim_navig(); var anim_interval = setInterval("anim_hlavicka();", 5000); $(window).resize(function() { anim_change_size(); });