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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:43:00+00:00 2026-05-24T11:43:00+00:00

When each image is clicked, the main image is supposed to change. I am

  • 0

When each image is clicked, the main image is supposed to change. I am having trouble accessing the correct selector. I have tried .parent and many different variations of the selector (i.e. img.redCarpet, redCarpet.img, etc.).

JQUERY

$('img.redCarpet').click(function () {
     var src = $(this).attr('src');
     $('#photoSpotImage').attr('src', src.replace(/-thumb/, ''));
 });

HTML

<div id="photoSpot"><img id="photoSpotImage"src="Images/photos/1/1.jpg" alt=""/></div>
<div class="thumbnailOverlay">
    <div class="thumbnailStyles">
        <div id="redCarpetCarousel">
            <div class="redCarpet">
                <img src="Images/photos/1-thumbs/1.jpg" alt="" />&nbsp;&nbsp;
                <img src="Images/photos/1-thumbs/10.jpg" alt="" />&nbsp;&nbsp;
                <img src="Images/photos/1-thumbs/100.jpg" alt="" />&nbsp;&nbsp;
                <img src="Images/photos/1-thumbs/101.jpg" alt="" />&nbsp;&nbsp;
                <img src="Images/photos/1-thumbs/102.jpg" alt="" />&nbsp;&nbsp;
            </div>
        </div>
    </div>
</div>

Thanks!

  • 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-24T11:43:01+00:00Added an answer on May 24, 2026 at 11:43 am
    $('.redCarpet img').click(function () {
         var src = $(this).attr('src');
         $('#photoSpotImage').attr('src', src.replace(/-thumb/, ''));
     });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have a MKmapView with a bunch of Image Annotation where each Image annotation
I have a set of jpeg images where each image has an associated description.
I have two models, Image and Tag . Each Image object can have more
I have multiple DIVs containing an image in each. When I rollover these DIVs,
I have 3 divs with 2 possible image tags for each (active or inactive).
in my app i have a list view. Each list consists of a image,
I have a dynamic table with each row having 4 columns. Column 1 has
I have a US HTML image map with the states highlighted with coordinates. Each
I have the standard setup of one main image and multiple thumbnails which can
I have a few images on a page. Each image has an id value

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.