Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript can’t turn a fadeTo in fadeIn

  • This topic is empty.
Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #30446
    allampatu
    Participant

    hello everybody

    i have a slideshow gallery with this fade

    var wrap = $("#image_wrap").fadeTo("medium", 0.5);

    that i don’t like to much. i prefer a classical fade in.

    so i tried to turn the fadeout in fadein but it doesn’t work.

    anybody could explain why? maybe because on page load the image is displaied?

    thanks a lot

    #78781
    coffeendonut
    Member

    wat do you mean by “fadeout in fadein” ..?

    #78797
    allampatu
    Participant

    sorry i mean fadeto() in fadein().

    #78798
    jamygolden
    Member

    Could we see the rest of your javascript?

    #78609
    allampatu
    Participant

    this is a flowplayer script

    it’s a thumb slideshow with a big preview and i would like to click on a thumb and with a fadein preview on big window

    $("#browsable").scrollable().navigator();

    $(function() {

    $(".scrollable").scrollable();

    $(".items img").click(function() {

    // see if same thumb is being clicked
    if ($(this).hasClass("active")) { return; }

    // calclulate large image's URL based on the thumbnail URL (flickr specific)
    var url = $(this).attr("src").replace("_t", "");

    // get handle to element that wraps the image and make it semi-transparent
    var wrap = $("#image_wrap").fadeTo("medium", 0.5);

    // the large image from www.flickr.com
    var img = new Image();


    // call this function after it's loaded
    img.onload = function() {

    // make wrapper fully visible
    wrap.fadeTo("fast", 1);

    // change the image
    wrap.find("img").attr("src", url);

    };

    // begin loading the image from www.flickr.com
    img.src = url;

    // activate item
    $(".items img").removeClass("active");
    $(this).addClass("active");

    // when page loads simulate a "click" on the first image
    }).filter(":first").click();
    });
    #78549
    jamygolden
    Member

    Try this:

    $("#browsable").scrollable().navigator();

    $(function() {

    $(".scrollable").scrollable();

    $(".items img").click(function() {

    // see if same thumb is being clicked
    if ($(this).hasClass("active")) { return; }

    // calclulate large image's URL based on the thumbnail URL (flickr specific)
    var url = $(this).attr("src").replace("_t", "");

    // get handle to element that wraps the image and make it semi-transparent
    var wrap = $("#image_wrap");

    // the large image from www.flickr.com
    var img = new Image();


    // call this function after it's loaded
    img.onload = function() {

    // make wrapper fully visible
    wrap.fadeTo("fast", 1);

    // change the image
    wrap.fadeTo("medium", 0.5).find("img").attr("src", url);

    };

    // begin loading the image from www.flickr.com
    img.src = url;

    // activate item
    $(".items img").removeClass("active");
    $(this).addClass("active");

    // when page loads simulate a "click" on the first image
    }).filter(":first").click();
    });
    #78542
    allampatu
    Participant

    thanks for your try but it doesn’t work.

    it goes to dark on image loaded

    #78445
    allampatu
    Participant

    i hope that the html code could help someone























    dish
    dish
    dish
    dish




    dish
    dish
    dish
    dish




    dish
    dish
    dish
    dish







    #77884
    allampatu
    Participant

    i know this is a very difficult thing
    so i’ve decided to embed this one http://pikachoose.com/demo/

    what do you think about?

Viewing 9 posts - 1 through 9 (of 9 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.