Need to change it from fadeTo to fadeIn

Discussion in 'jQuery' started by qwikad.com, Jul 26, 2014.

  1. #1
    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.

    
    <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>
    
    Code (markup):

     
    qwikad.com, Jul 26, 2014 IP
  2. alfa_375

    alfa_375 Active Member

    Messages:
    445
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #2
    I hope you got the answer already, so do you mind to share, what you did exactly to get the fadein effect?
     
    alfa_375, Aug 15, 2014 IP
  3. qwikad.com

    qwikad.com Illustrious Member Affiliate Manager

    Messages:
    7,279
    Likes Received:
    1,696
    Best Answers:
    31
    Trophy Points:
    475
    #3
    I didn't. I realized it would be impossible to do unless the other jquery file was re-written. So I left it at that. The fadeTo affect is kind of quirky in my view, that's why I wanted to change it. But it still can be used with no problem.
     
    qwikad.com, Aug 15, 2014 IP
  4. alfa_375

    alfa_375 Active Member

    Messages:
    445
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #4
    Thanks for you reply, I am an experienced programmer in php/mysql but the having lot of problems with the jquery things. That is why I usually visit here to see the problems and solutions.
     
    alfa_375, Aug 15, 2014 IP