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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T14:40:04+00:00 2026-06-14T14:40:04+00:00

Bergi (stack overflow user) so graciously helped me come up with a solution for

  • 0

Bergi (stack overflow user) so graciously helped me come up with a solution for image swap using jQuery. It swaps on hover now, but id like to make it so that it stays highlighted on your current sub site (for example, I click on “Comics” page, and “Comics” stays highlighted). Is that possible? Thanks!

    <script type="text/javascript">
        var images = {
            "comicssubsite": [
                "./images/SiteDesign/Comics_subsites_hover.png",
                "./images/SiteDesign/Comics_subsites.png"
            ],
            "artworksubsite": [
                "./images/SiteDesign/Artwork_subsites_hover.png",
                "./images/SiteDesign/Artwork_subsites.png"
            ],
            "aboutsubsite": [
                "./images/SiteDesign/About_subsites_hover.png",
                "./images/SiteDesign/About_subsites.png"
            ],
            "blog": [
                "./images/SiteDesign/Blog_othersites_hover.png",
                "./images/SiteDesign/Blog_othersites.png"
            ],
            "facebook": [
                "./images/SiteDesign/Facebook_othersites_hover.png",
                "./images/SiteDesign/Facebook_othersites.png"
            ]
        };

        jQuery(document).ready(function($) {
            $("#comicssubsite, #artworksubsite, #aboutsubsite, #blog, #facebook").hover(function(e) {
                 // mouseover handler
                 if (this.id in images) // check for key in map
                     this.src = images[this.id][0];
            }, function(e) {
                 // mouseout handler
                 if (this.id in images)
                     this.src = images[this.id][1];
            });
        });
  • 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-14T14:40:05+00:00Added an answer on June 14, 2026 at 2:40 pm

    Zotal Toth’s answer should work, but you should consider changing your mouseout-handler like so, unless you want the image to change back, once a user hovers over it:

    // mouseout handler
    var section = document.location.href.split("/")[url.split("/").length-1].split(".")[0];
    if (this.id in images) {
       if this.id != section
           this.src = images[this.id][1];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: I figured it out from Bergi's answer in the end. Thanks Bergi. pubPrivExample
I've got an application, which is tabbed (using TabNavigator). When it starts, I switch
I'm looking to create a simple animation loop using html canvas. Each path(or triangle)
I have a JSON object that I am trying to read using Python but
Since this is answered I put the simplest answer here. (Thanks to Bergi) first
I find it quite confusing what exactly are the differences in using Flask's before_request()
In WPF, when a user gets focus in a TextBox , I would like
My code just creates inline-diff (on a per-word basis) of a string using HTML
I use a piece of code like this to show an alert using the
i have a litte problem... i created a litte script (for jQuery HoverIntent-Plugin) the

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.