Results 1 to 2 of 2

Thread: Need to change it from fadeTo to fadeIn

  1. #1
    Join Date
    Oct 2012
    Posts
    180
    Thanks
    22
    Thanked 1 Time in 1 Post

    Default Need to change it from fadeTo to fadeIn

    How can I change it from fadeTo to fadeIn? Just changing it to fadeIn didn't do the trick. I'd like for an image to fade in slowly on click.

    Code:
    <script>
    $(function() {
    $(".scrollable").scrollable();
    $(".items img").click(function() {
    if ($(this).hasClass("active")) { return; }
    var url = $(this).attr("src").replace("_t", "");
    var wrap = $("#image_wrap").fadeTo("medium", 0.5);
    var img = new Image();
    img.onload = function() {
    wrap.fadeTo("fast", 1);
    wrap.find("img").attr("src", url);
    };
    img.src = url;
    $(".items img").removeClass("active");
    $(this).addClass("active");
    }).filter(":first").click();
    });
    </script>

  2. #2
    Join Date
    Mar 2010
    Location
    Florida
    Posts
    512
    Thanks
    9
    Thanked 61 Times in 59 Posts

    Default

    Assuming you are using JQuery
    $("#image_wrap img").fadeIn(400);

    However if there is an example somewhere like a page then please post it
    -DW [Deadweight]
    Resolving your thread: First Post: => EDIT => Lower right: => GO ADVANCED => Top Advance Editor drop down: => PREFIX:Resolved

Similar Threads

  1. jQuery fadeTo image slideshow issues
    By Rockonmetal in forum JavaScript
    Replies: 0
    Last Post: 05-16-2009, 01:17 AM
  2. Background fadein/fadeout
    By Trishah in forum JavaScript
    Replies: 2
    Last Post: 01-14-2009, 03:11 PM
  3. Ultimate Fadein Slideshow v1.5
    By robpet1972 in forum Dynamic Drive scripts help
    Replies: 2
    Last Post: 07-15-2007, 04:44 PM
  4. Fadein-slideshow
    By Peppy in forum Dynamic Drive scripts help
    Replies: 3
    Last Post: 03-28-2005, 08:57 PM
  5. FadeIn Slideshow
    By Aimelie in forum Dynamic Drive scripts help
    Replies: 11
    Last Post: 11-04-2004, 10:26 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •