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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:54:21+00:00 2026-06-12T01:54:21+00:00

A while back I set up the following to have a very simple image

  • 0

A while back I set up the following to have a very simple image swap using jQuery. Now that the site needs to expand, however, I cannot figure out the actual value of the $(this) selector. I thought it would be $(‘.gallery li img’) but that doesn’t seem to be the case. It’s been a while since I’ve looked at this code, and I’m entirely lost.

$('.gallery li img').hover(function() {
    var $gallery = $('.gallery li img').parents('.gallery');
    var cur_img = $(this).attr('src').replace('thumb/', '');
    $('.main-img', $gallery).attr('src', cur_img);
});​

I don’t need a better means to set up a gallery, what I have works fine (although comments are appreciated as always) I just need to figure out the value of $(this) in the given circumstance.

  • 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-12T01:54:22+00:00Added an answer on June 12, 2026 at 1:54 am

    Isn’t the (this) in jQuery just a self-referential? Meaning, basically, “whatever is currently selected or focussed on?” (Sorry – don’t know how to comment, or I’d do that instead.)

    Looking at your code, it looks like it’s just replacing the current image’s source with the prefixed path “thumb/”.

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

Sidebar

Related Questions

A while back I created a lightbox plugin using jQuery that would load a
A while back I was playing with methods using variable-length argument lists (java) that
I little while back I posted this question . I have updated that question
A while back, I remember using a piece of code (4-5 lines), added to
A while back a found a great-looking framework that allowed .net developers to implement
A while back I wrote a simple python program to brute-force the single solution
a while back, CNET had these really cool Social Share buttons, that when you
I have a following form Form3 that is opened by another form Form1, and
I have the following javascript code, which is doing an image rotation on a
I currently have the following funciton in an oracle database that returns a concatenated

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.