Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8522141
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:01:49+00:00 2026-06-11T07:01:49+00:00

I am trying to fade in an image when I click on a link,

  • 0

I am trying to fade in an image when I click on a link, but that gives me a “blink” on every fade. Is there anyway to avoid this blink and just have a clean fadeIn?

This is my current code:

function changeMortar(mortar) {
     var html = '<img src="http://www.randerstegl.dk/fileadmin/fugefarver/GFXSharedMortars/fuge'+mortar+'.png" width="500" height="300">'                    
        $("#fuge-color").hide().html(html).fadeIn('slow');
    }​

I have made this example
http://jsfiddle.net/BHCam/14/

It fades to white and then into the mortar I selected. What I want is to have my selected mortar, fade over the old mortar.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T07:01:51+00:00Added an answer on June 11, 2026 at 7:01 am

    I have made some changes to your code. Try like this in HTML:

    <div id="slideshow">
       <img src="http://www.randerstegl.dk/fileadmin/fugefarver/GFXSharedMortars/fugeGraa.png" alt="" class="active" width="500" height="300"/>
       <img src="http://www.randerstegl.dk/fileadmin/fugefarver/GFXSharedMortars/fugeAnthrazit.png" width="500" height="300" />
    
    </div>
    <a href="#" class="change-mortar-link" onclick="slideSwitch();">Change mortar</a>
    

    In CSS:

    #slideshow {
       position:relative;
       height:350px;
    }
    #slideshow IMG {
      position:absolute;
      top:0;
      left:0;
      z-index:8;
    }
    #slideshow IMG.active {
       z-index:10;
    }
    #slideshow IMG.last-active {
       z-index:9;
    }
    

    And The JavaScript code:

    function slideSwitch() {
       var $active = $('#slideshow IMG.active');
    
       if ( $active.length == 0 ) $active = $('#slideshow IMG:last');
    
       var $next =  $active.next().length ? $active.next()
        : $('#slideshow IMG:first');
    
       $active.addClass('last-active');
    
       $next.css({opacity: 0.0})
          .addClass('active')
          .animate({opacity: 1.0}, 1000, function() {
              $active.removeClass('active last-active');
         });
      }
    

    And in here you can find more information. And here is the running example in JsFiddle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying get this background to fade in on click. I found one
Im trying to make this image fade into the one below it using a
I am trying to get an image to fade out when there has been
I am trying to fade an image in a canvas environment. Essientially what I
I'm trying to make an image fade in/out when the user hovers over the
I am trying to use jquery to replace an image on rollover (with fade)
I'm trying to change the source of an image and have t fade in
I'm trying to make it so that when you click the navigation buttons at
I'm trying to fade one image to second on mouse enter and reverse on
I'm trying to build an image gallery (or, ideally, find a jquery plugin) that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.