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 7992251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T13:30:33+00:00 2026-06-04T13:30:33+00:00

How i get in this code a fade effect? When i click on the

  • 0

How i get in this code a fade effect?
When i click on the thumbs, the should fade the “big” picture!

This is the gallery demo http://workshop.rs/demo/gallery-in-4-lines/

<div class="box">
        <div id="panel"><img id="largeImage" src="pic/image_08_large.jpg" /> </div>
        <div class="text"> Die Idee und das Konzept</div>
        <div id="thumbs">
        <img src="pic/image_08_thumb.jpg" alt="1st image description" />
        <img src="pic/image_09_thumb.jpg" alt="2nd image description" />
        <img src="pic/image_10_thumb.jpg" alt="3rd image description" />

        </div>

Javascript

<script>

$('#thumbs').delegate('img','click', function(){
$('#largeImage').attr('src',$(this).attr('src').replace('thumb','large'));
$('#description').html($(this).attr('alt'));
});

</script>

css:

#thumbs { padding-top: 10px; overflow: hidden; }
#thumbs img, #largeImage { border: 1px solid gray; padding: 4px; 
background-color:white; cursor: pointer; }
#thumbs img { float: left; margin-left:60px;  margin-top:10px; }
#description { background: black; color: white; position: absolute; bottom: 0;   
padding: 10px 20px; width: 525px; margin: 5px; }
#panel { position: relative; }
  • 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-04T13:30:34+00:00Added an answer on June 4, 2026 at 1:30 pm

    With your code you cannot achieve the desired effect. So you’ll need to:

    • (…to get the desired efx:) have 2 images placed inside the ‘panel’ (you can clone the clicked one!)
    • Than you need to 1: place the clone in place (needs to be hidden initially)
    • 2: fade the old image
    • 3: fade In the clone (new) image like:

    jsBin demo example

    $('.thumbs').on('click','img', function(){
            var $thisPanel = $(this).parents('.gallery').find('.panel');
            var clone = $(this).clone().hide();
            clone.appendTo($thisPanel);
            $thisPanel.find('img').eq(0).fadeTo(600,0,function(){
               $(this).remove();
            });
            clone.fadeTo(600,1);  
            $('.description').html($(this).attr('alt'));
    });
    

    Don’t use ID for elements that are multiple on your page, instead use class. (See the demo):

    <div class="gallery">
        <div class="panel">
            <img src="http://placehold.it/565x300/cf5" />
            <div class="description">First image description</div>
        </div>
     
        <div class="thumbs">
            <img src="http://placehold.it/565x300/cf5" alt="1st image description" />
            <img src="http://placehold.it/565x300/f0f" alt="2nd image description" />
            <img src="http://placehold.it/565x300/444" alt="3rd image description" />
        </div>
    </div>
    

    And the CSS:

      .thumbs { padding-top: 10px; overflow: hidden;}
        .thumbs img, .panel img {
         border: 1px solid gray;
         padding: 4px;
         background-color: white;
         cursor: pointer;
        }
      .panel img{
        position:absolute;
      }
        .thumbs img {
         float: left;
         margin-right: 3px;
        width:100px;
        }
        .description {
         background: black;
         color: white;
         position: absolute;
         z-index:2;
         bottom: 0;
         padding: 10px 20px;
         width: 525px;
         margin: 5px;
        }
      .panel { position: relative; height:310px; }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using below code to get fade in fadeout effect for menus. Presently
I get this code from a book but i could not get it work.
Why do I get this error message with this code? Use of undeclared identifier
I have this code and I couldn't run it because i get this error:
I am working with NHibernate and I get this code below: public class User
If I run this code on IE8 or lower, I get this error: Object
Hello you naughty code animals.. I have tried to get this code to work,
I'm trying to get this C++ code to input a series of numbers from
i am new in programming under linux and trying to get working this code:
i get this dialog while debugging code in visual studio 2008. (your step-into request

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.