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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:41:28+00:00 2026-05-26T20:41:28+00:00

I have 8 thumbnails, when the user hovers over any one of them, a

  • 0

I have 8 thumbnails, when the user hovers over any one of them, a separate div named ‘target’ displays an image. By default ‘target’ is an empty div, until one of the thumbnails are hovered.

Question:
How do I set ‘target’ to have a default image, without messing up the currently functionality of the hover? I would like for that default image to be ‘chart’

<style>
#target { width: 1220px; height: 400px; }

.chart { background: url("theme/images/timeline.png") no-repeat 0 0; }

.html { background: url("theme/images/html_graph.png")  no-repeat 0 0; }
.oracle { background: url("theme/images/oracle_graph.png") no-repeat 0 0; }
.linux { background: url("theme/images/linux_graph.png") no-repeat 0 0; }
.php { background: url("theme/images/php_graph.png") no-repeat 0 0; }
.java { background: url("theme/images/java_graph.png") no-repeat 0 0; }
.prod { background: url("theme/images/prod_graph.png") no-repeat 0 0; }
.design { background: url("theme/images/design_graph.png") no-repeat 0 0; }
.pm { background: url("theme/images/pm_graph.png") no-repeat 0 0; }
</style>

<script type="text/javascript" language="Javascript/1.2">
function change(v) {
    var target = document.getElementById("target");
    if (v == "imgA") {
        target.className = "html";
    } else if (v == "imgB") {
        target.className = "oracle";
    } else if (v == "imgC") {
        target.className = "linux";
    } else if (v == "imgD") {
        target.className = "php";
    } else if (v == "imgE") {
        target.className = "java";
    } else if (v == "imgF") {
        target.className = "prod";
    } else if (v == "imgG") {
        target.className = "pm";
    } else if (v == "imgH") {
        target.className = "design";
    } else {
        target.className = "chart";
    }
}
function changeReset() {
    var target = document.getElementById("target");
    target.className = "";
}
</script>

</head>

<body>
    <div>
        <a id="imgA" onmouseover="change('imgA');" onmouseout="changeReset();" href="#"><img src="theme/images/Albania.png" alt="" /></a>
        <a id="imgB" onmouseover="change('imgB');" onmouseout="changeReset();" href="#"><img src="theme/images/Algeria.png" alt="" /></a>
        <a id="imgC" onmouseover="change('imgC');" onmouseout="changeReset();" href="#"><img src="theme/images/Brazil.png" alt="" /></a>
        <a id="imgD" onmouseover="change('imgD');" onmouseout="changeReset();" href="#"><img src="theme/images/Brunei.png" alt="" /></a>
        <a id="imgE" onmouseover="change('imgE');" onmouseout="changeReset();" href="#"><img src="theme/images/Chad.png" alt="" /></a>
        <a id="imgF" onmouseover="change('imgF');" onmouseout="changeReset();" href="#"><img src="theme/images/Chad.png" alt="" /></a>
        <a id="imgG" onmouseover="change('imgG');" onmouseout="changeReset();" href="#"><img src="theme/images/Chad.png" alt="" /></a>
        <a id="imgH" onmouseover="change('imgH');" onmouseout="changeReset();" href="#"><img src="theme/images/Chad.png" alt="" /></a>
    </div>
    <div id="target"></div></body>
  • 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-26T20:41:28+00:00Added an answer on May 26, 2026 at 8:41 pm

    The code you have to deal with is pretty gross. If this page is going to require ongoing maintenance or if you just want to sleep better at night consider using unobtrusive javascript and a nice DOM manipulation library like JQuery to clean this up like so. If I understand your question I believe all you need to do is change:

    <div id="target"></div>
    

    to have the chart class on it by default:

    <div id="target" class="chart"></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a series of thumbnails. One by default has an active class of
I'm using http://lokeshdhakar.com/projects/lightbox2/ . I have image thumbnails and on clicking them they open
I have displaying image thumbnails in a UIScrollView , if user taps on a
I have a text link. When the user hovers over the text link, I
I have a table named users and each row (user) has an image. The
I have 2 models: Video: class Video < ActiveRecord::Base belongs_to :user has_many :thumbnails attr_accessor
I have thumbnails on a page, as such: <div id=credits> <a href=largeimage1.jpg alt=credits1.php><img src=thumb1></a>
I have a page with 50 thumbnails that load once a user enters the
How would I have a default slideshow of thumbnails, like gallerific ! and when
I have a set of images that correspond to video thumbnails. The user clicks

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.