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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T22:49:19+00:00 2026-05-28T22:49:19+00:00

I trying to do circle hover area with mapping what must work in ie7,

  • 0

I trying to do circle hover area with mapping what must work in ie7, I almost finished but I’m beginner in JS an get an issue with code what must change img for map when hover on the area, first btn works great but for second it’s not working. Take a look at patient https://www.mycleverphone.com/sergiu/Q/circle I used 2 image what must switch when hover.
Here its code used:

JS – in head section

<script type="text/javascript">
function init(){
document.getElementsByTagName('area')[0].onmouseover=function(){
document.getElementById('but').src='img/circle_number_hover.png';
this.onmouseout=function() {
document.getElementById('but').src='img/circle_number.png';
}}}
if(window.addEventListener){
window.addEventListener('load',init,false);
}else {
if(window.attachEvent){
window.attachEvent('onload',init);
}}
</script>

NTML

<div id="bt">
 <ul>
    <li id="circbut1">
    <img id="but" src="img/circle_number.png" width="250" height="50" alt="" usemap="#circleBtn1" />
    <map name="circleBtn1">
        <area shape="circle" coords="25,25,25" alt="1" href="#1"/>
    </map>
    </li>
    <li id="circbut2">
    <img id="but" src="img/circle_number.png" width="250" height="50" alt="" usemap="#circleBtn2" />
    <map name="circleBtn2">
        <area shape="circle" coords="75,25,25" alt="2" href="#2"/>
    </map>
    </li>
 </ul>
</div>

CSS

#bt {
padding-bottom: 100px;
position: relative;
display: block;
}
#bt ul {
position: absolute;
float: left;
    list-style:none;
}
#bt ul li img {
border: none;
}
#bt ul li {
display: block;
float: left;
}
#bt ul li#circbut1 {
position: absolute;
clip: rect(0 50px 50px 0);
}
#bt ul li#circbut2 {
position: absolute;
padding-left: 10px;
clip: rect(0 110px 50px 60px);
}

I need 5 button like this in horizontal line after this 2, if code technique its seam I will do, just tel me whats rung with this one and a solution to fix.
Or if its a shortest way to get seam result with less java or loading external file I will be really thankful. An also its important, its must work in ie7.

Thank you in advance

  • 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-28T22:49:19+00:00Added an answer on May 28, 2026 at 10:49 pm

    The Attribut ID should only be used ONCE in a html document.

    function init() {
        var i, j = document.getElementsByTagName('area').length;
    
        for(i=0;i<j;++i) {
            document.getElementsByTagName('area')[i]._C_i = i + 1;
            document.getElementsByTagName('area')[i].onmouseover = function() {
                document.getElementById('but' + this._C_i).src = 'img/circle_number_hover.png';
            }
            document.getElementsByTagName('area')[i].onmouseout = function() {
                document.getElementById('but' + this._C_i).src = 'img/circle_number.png';
            }
        }
    }
    

    Your init() function should look like this. (Except .onmouseover and .onmouseout <= use addEventLi…)

    Now change your HTML Code to this (change: different ID’s):

    <div id="bt">
     <ul>
        <li id="circbut1">
        <img id="but1" src="img/circle_number.png" width="250" height="50" alt="" usemap="#circleBtn1" />
        <map name="circleBtn1">
            <area shape="circle" coords="25,25,25" alt="1" href="#1"/>
        </map>
        </li>
        <li id="circbut2">
        <img id="but2" src="img/circle_number.png" width="250" height="50" alt="" usemap="#circleBtn2" />
        <map name="circleBtn2">
            <area shape="circle" coords="75,25,25" alt="2" href="#2"/>
        </map>
        </li>
     </ul>
    </div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use document.createElement('circle') to work with svgs but Chrome creates a end
So Here is the Problem, I am trying to get that circle to align
I'm trying to calculate the area of the circle and the rectangle by using
Okay, so on my website, I'm trying to get this to work: The visitor
I am trying to draw a white circle with the following code: mPaint.setColor(0xFFFFFFFF); canvas.drawCircle(x,
I am trying to draw a circle using the following code. -(void)drawRect { CGContextRef
I am trying to draw a circle using Windows Form at runtime inside a
I'm going round in circles at the moment trying to get the pattern right
Trying to get my css / C# functions to look like this: body {
Trying to create a QtRuby application, I get the following error: /usr/lib64/ruby/site_ruby/1.8/Qt/qtruby4.rb:2144: [BUG] Segmentation

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.