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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:08:52+00:00 2026-05-16T01:08:52+00:00

I know nearly nothing about this all so I turn to you for some

  • 0

I know nearly nothing about this all so I turn to you for some desperately needed help. If you need to see any more code or info just ask and i’ll answer asap.

the following code snippet is what im using for a photo gallery on:

http://luisposada.co.uk/home/photography-2/

The problem is the following the caption below the main picture appears on one click when you go through the thumbnails from left to right but on a double click only going from right to left. Obviously i want the captions to change no matter what order the thumbnails are clicked in and on a single click.

Thank you very much.

<script type="text/javascript"> 

$(function() {
   $('#feature').cycle({
       speed:       1000,
       timeout:     <?php echo $speed; ?>
   });

$("#yc_thumbnail_frame a").live("click",function(){
    $(".yc_img_fullsize").each(function(index) {
        if ($(this).is(":visible")) {
            var text = $(this).attr("alt");
            $(".caption").html(text);
        }
    });
  });
});

$(window).load(function() {
   $("img.yc_img_fullsize").each(function(index) {
    if ($(this).is(":visible")) {
        var text = $(this).attr("alt");
        $(this).parent().after("<p class='caption'>" + text + "</p>");
    }
  });

});

</script> 
  • 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-05-16T01:08:53+00:00Added an answer on May 16, 2026 at 1:08 am

    The following change to the #yc_thumbnail_frame a click event handler should fix it up for you:

    $("#yc_thumbnail_frame a").live("click",function(){
    
        // Instead of looking for the visible image, find the one that matches the thumbnail src
        var thumbSrc = $(this).find('img').attr('src');
        $(".yc_img_fullsize").each(function(index) {
            if ($(this).attr('src') == thumbSrc) {
                var text = $(this).attr("alt");
                $(".caption").html(text);
            }
        });
      });
    });
    

    The reason it’s not currently working as you’d expect is because when you click one of the thumbnail links, it cycles through all the large images and figures out which one is visible. When it finds the visible one, it then sets the caption text from its alt text.

    It seems that setting the large image visible is slightly slower than trying to determine its caption text.

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

Sidebar

Related Questions

It struck me the other day that I know nearly nothing about the hardware
This is probably something stupid, but I don't know nearly enough about rails &
I know this is platform-specific question, however, I would like to do some run-time
We've probably all seen this screen when testing, all you need is a HTTPS
I know, there are several posts with nearly the same question, but all the
I know this is a pretty common problem but any of the solutions I
I know this has been asked quite a bit , but I need to
We all know it is nearly impossible to produce a large website without one
First off, I'm a javascript noob and know nearly nothing of regex. I'm trying
Know this might be rather basic, but I been trying to figure out how

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.