Skip to content Skip to sidebar Skip to footer

Load First Image On Custom Gallery With Fadein Effect

i get this script to custom build some image gallery: $('#plantas-img a').click(function(){ image = $('').attr('src', $(this).attr('href')); $('#planta

Solution 1:

To load the first image from the list to the big image, to can do something like that:

$(document).ready(function() {

    var image = $("<img />").attr(
       "src", 
       $(".thumbs li:first-child a").attr("href"));

    $("#plantas-img .img_big").html(image);
}

To add fade in and out effects, you can use the jquery fading functions. Just call them on your "onclick" events.

Solution 2:

Change javascript to something like this to load first one and fade in

$('#plantas-img a').click(function(){
        image = $("<img />").attr("src", $(this).attr("href"));
        $("#plantas-img .img_big").hide().html(image).fadeIn(500);
        returnfalse;
    }).eq(0).click();

Post a Comment for "Load First Image On Custom Gallery With Fadein Effect"