Nazdarek. Urobil som si Jquery script (taky jednoduchy iframe Slider) na prezeranie obrazkov.
Vsetko funguje dobre akurat mam problem pri zobrazeni prvotneho obrazka. Ten je absolutne bez "efektov". Neviete mi niekto poradit ako upravit tu funkciu, aby aj ten prvotny obrazok bol s "efektom"??
Tu je skrateny kod:
jquery:
Kód:
$(document).ready(function()
{
function showSliderImage (ni) {
var newImg="<img src='"+ picture[ni].src+"' title='"+imgNam[ni]+"' style='float: left'>";
$("#ImgLr").fadeOut(500, function () {
$("#ImgLr").html(newImg).css('display', 'none');
var New_height= $("#ImgLr").outerHeight();
var New_width= $("#ImgLr").outerWidth();
var NewH= New_height+"px";
var NewW= New_width+"px";
$("#shImg").animate({width: NewW, height: NewH}, 500, function (){
$("#ImgLr").html(newImg).fadeIn(500);
});
});
}
});
php:Kód:
echo "<div id='Img_bg' style='width: 100%; height: auto; position: absolute; top: 240px; left: 0px; margin: 0px auto; text-align: center; border: 1px solid red'>
<div id='shImg' class='shImg_bg'>
<div id='ImgLr'>
<img src='./images/$imgName ' title='$imgTitle'> // Toto je ten prvotny obrazok bez efektov
</div>
</div>
</div>";