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

  • Home
  • SEARCH
  • 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 6562329
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:41:48+00:00 2026-05-25T13:41:48+00:00

Basically I transformed a rollover from my css to javascript. I also chose one

  • 0

Basically I transformed a rollover from my css to javascript. I also chose one of the pictures to be selected once the page is loaded. But am having trouble with the onMouseOut event. Everything works perfect except that picture. When I hover over other pictures that picture remains selected. I tried multiple ways but don’t know how to fix it.. any ideas?

<script type="text/javascript">

window.onload=function(){
clicked3();
}

function clicked3(){
document.getElementById("clicked3").style.backgroundPosition = "-198px top";
}

function handleOver3() { 
 if (document.getElementById("clicked3")) document.style.backgroundPosition="-198px top";
 }


function handleOut3() {
 if (document.getElementById("clicked3")) document.style.backgroundPosition="0px top";
}

</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-25T13:41:48+00:00Added an answer on May 25, 2026 at 1:41 pm

    You don’t showed an registration of handlers for onmouseover and onmouseout events? Next code example may help you.

    HTML:

    <div id='clicked1' style='width:140px;height:183px;background:URL(http://t3.gstatic.com/images?q=tbn:ANd9GcQbcDkaRcrbsYFUcE6Q7n56_LJr-r4mDqYTOTtPKG9J0MzZcV6V)' />
    <div id='clicked2' style='width:140px;height:183px;background:URL(http://t3.gstatic.com/images?q=tbn:ANd9GcQbcDkaRcrbsYFUcE6Q7n56_LJr-r4mDqYTOTtPKG9J0MzZcV6V)' />
    <div id='clicked3' style='width:140px;height:183px;background:URL(http://t3.gstatic.com/images?q=tbn:ANd9GcQbcDkaRcrbsYFUcE6Q7n56_LJr-r4mDqYTOTtPKG9J0MzZcV6V)' />
    

    SCRIPT:

    <script type="text/javascript">
    
    window.onload=function() {
        var domClicked1=document.getElementById("clicked1");
        var domClicked2=document.getElementById("clicked2");
        var domClicked3=document.getElementById("clicked3");
        clicked.call(domClicked1);
        clicked.call(domClicked2);
        clicked.call(domClicked3);
        domClicked1.onmouseover=
        domClicked2.onmouseover=
        domClicked3.onmouseover=handleOver; // but you must switch to use addEventListener (or attachEvent for IE8 and less)
        domClicked1.onmouseout=
        domClicked2.onmouseout=
        domClicked3.onmouseout=handleOut;
    }
    
    function clicked(){
        this.style.backgroundPosition = "-140px top";
    }
    
    function handleOver() {
        this.style.backgroundPosition = "0px top";
    }
    
    function handleOut() {
        this.style.backgroundPosition = "-140px top";
    }
    
    </script>
    

    http://jsfiddle.net/J2SrF/

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

Sidebar

Related Questions

Basically I am trying to restart a service from a php web page. Here
Basically the page is coded centered, but what happens is that on load it
Basically idea is to grab data from MySQL table and transform it to JSON.
We are using Inkscape basically as a means to create SVGs. Once done, we
Basically if I want to transform a name from stephen smith to Stephen Smith
Basically for this case, I am using the _winreg module in Python v2.6 but
Basically, I want to render an image (bitmap) on an ImageView, but change its
Basically what I want to do it this: a pdb file contains a location
Basically, something better than this: <input type=file name=myfile size=50> First of all, the browse
Basically I have some code to check a specific directory to see if an

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.