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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T04:11:50+00:00 2026-05-11T04:11:50+00:00

I have a image in the shape of a Circle. The circle is broken

  • 0

I have a image in the shape of a Circle.

The circle is broken into 3 equal parts.

I have an image with the entire circle.

I have 3 other images, each only a piece of the circle but in the color green.

I have to do the following:

  1. Display the original circle image.

  2. Have a 3 buttons on the screen, each button is linked to the 3 parts of the circle. When clicked, it overlays the green image over the circle. So if you clicked all 3 buttons, the entire circle would be green. If you only clicked the 1st button, only that section of the circle would be green.

How can I implement this? Is it possible to overlay 2 images at once? Do I have to play with x and y positioning here? (the green image sections currently, if you place them over the original image, will lineup exactly with the original circle image.

  • 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. 2026-05-11T04:11:50+00:00Added an answer on May 11, 2026 at 4:11 am

    Here’s a solution shown in straight JavaScript and also jQuery.
    The straight JavaScript uses the DOM0 onclick handlers of the buttons which is OK because they’re only triggering one event. The onload handler for the window is more of a problem: you can only have one per document.
    The jQuery solution is much shorter as you can see, but you’ll have to include the jQuery library. The $( function(){} ) takes the place of the window onload handler but you can have as many as you like.

    The images sector1.gif, sector2.gif and sector3.gif are transparent apart from the bits of the circle that are visible for them. You could use .png too but that wouldn’t work in ie6 without some tweakery.

    <!-- the markup --> <div id='circle'>     <div id='sector1'></div>     <div id='sector2'></div>     <div id='sector3'></div> </div> <input type='button' id='button1' value='Sector 1'> <input type='button' id='button2' value='Sector 2'> <input type='button' id='button3' value='Sector 3'> 

    _

    /* the style */ #circle{     width: 100px;     height 100px;     position: relative;     background: url( images/circle.gif ); }  #sector1, #sector1, #sector1 {     width: 100px;     height 100px;     top: 0;     left: 0;     position: absolute;     display: none; } #sector1 {     background: url( images/sector1.gif ); } #sector2 {     background: url( images/sector2.gif ); } #sector2 {     background: url( images/sector3.gif ); } 

    _

    //basic javascript solution window.onload = function() {     // get references to the buttons     var b1 = document.getElementById( 'button1' );     var b2 = document.getElementById( 'button2' );     var b3 = document.getElementById( 'button3' );      // get references to the sectors     var s1 = document.getElementById( 'button1' );     var s2 = document.getElementById( 'button2' );     var s3 = document.getElementById( 'button3' );      // add onclick events to the buttons which display the sectors     b1.onclick = function() { s1.style.display = 'block'; }     b2.onclick = function() { s2.style.display = 'block'; }     b3.onclick = function() { s3.style.display = 'block'; } }   //jQuery solution $(function() {     $('#button1').click( function() { $('#sector1').show() } );     $('#button2').click( function() { $('#sector2').show() } );     $('#button3').click( function() { $('#sector3').show() } ); }); 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have several binary images and my task is to segment circle-like shape. The
I have an image map with two different area shape attributes. I want to
I have this code to identify two different image map shape attributes. What I'm
I have divided a rectangular shaped image into two pieces as as shown below
My site needs to have image based posts, meaning the post is only an
I want to draw UIButton in following shape : I have cut the image,
I have an UIImageView on my view. Certain parts of that image, I want
I have a PNG image of black sock shape with a transparent background. I
I have a graph defined as such: digraph G { rankdir=LR node[shape=circle] q_[shape=none label=]
I have an image button with a background image .png of a circle. I

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.