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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T18:42:12+00:00 2026-06-04T18:42:12+00:00

I’m trying to create a circular menu in CSS for a school project. This

  • 0

I’m trying to create a circular menu in CSS for a school project.

This is what the menu would look like:

enter image description here

I am not looking for the complete source just an idea how you experienced developers would do it.

I was thinking to create 8 triangles and then the middle to place a circlular div with position absolute; but the triangles, since they’re created with borders, when you hover them they are not absolutely selectable. It’s kinda buggy.

Is it even possible to create this with no images?

EDIT:

The menu will after by animated using jQuery; thus I will be using jQuery and jQuery UI but no other library and no images (i dont need the icons anyway).
As for compatibility, should work on IE9+ / Chrome / Opera 11.52+ / Firefox 4+.

  • 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-04T18:42:14+00:00Added an answer on June 4, 2026 at 6:42 pm

    The following is a way to do it with HTML canvas, and it detects where the mouse is perfectly. It doesn’t look the exact same as yours though, and I didn’t add the icons or dividing lines (although anti-aliasing allows the background to show through a little between regions creating the illusion of lines being drawn).

    http://jsfiddle.net/jcubed111/xSajL/

    Edit – Bug Fix: http://jsfiddle.net/jcubed111/xSajL/2/

    With more work you could make the canvas version look the same as your mock-up, my version is only to get the functionality down.

    You could also make it look right with css, then overlay a clear a to detect mouse position and provide linking functionality. Of course, then you couldn’t use :hover to change the look of the regions.

    I’ve tested in Chrome 19 only.

    Here’s the full code below in case the link goes down:

    HTML:

    <a id='link'><canvas id='c' width='224' height='224' onmousemove="update(event);"></canvas></a>
    <input id='i' />​​​​​​​​
    

    CSS:

    #c{
        width:224px;
        height:224px;
    }​
    

    JS (run on page load and uses jquery):

    ctx = $('#c')[0].getContext('2d');
    
    
    function update(E) {
        ctx.clearRect(0, 0, 224, 224);
        if (E === false) {
            mx = 112;
            my = 112;
        } else {
            mx = E.clientX;
            my = E.clientY;
        }
    
        mangle = (-Math.atan2(mx-112, my-112)+Math.PI*2.5)%(Math.PI*2);
        mradius = Math.sqrt(Math.pow(mx - 112, 2) + Math.pow(my - 112, 2));
    
        $('#i').val("Not over any region");
        $('#link').attr('href', '');
        for (i = 0; i < 8; i++) {
            angle = -Math.PI / 8 + i * (Math.PI / 4);
    
            if (((mangle > angle && mangle < (angle + Math.PI / 4)) || (mangle > Math.PI*15/8 && i==0)) && mradius<=112 && mradius>=69) {
                ctx.fillStyle="#5a5a5a";
                $('#i').val("In region "+i);
                $('#link').attr('href', '#'+i);
            } else {
                ctx.fillStyle="#4c4c4c";
            }
    
            ctx.beginPath();
            ctx.moveTo(112, 112);
            //ctx.lineTo(112+Math.cos(angle)*112, 112+Math.sin(angle)*112);
            ctx.arc(112, 112, 112, angle, angle + Math.PI / 4, false);
            ctx.lineTo(112, 112);
            ctx.fill();
    
    
        }
    
        ctx.fillStyle = "#f2f2f2";
        ctx.beginPath();
        ctx.arc(112, 112, 69, 0, 2 * Math.PI, false);
        ctx.fill();
    }
    
    update(false);​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Basically, what I'm trying to create is a page of div tags, each has
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to render a haml file in a javascript response like so:
I would like to run a str_replace or preg_replace which looks for certain words
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to create an if statement in PHP that prevents a single post
I have some data like this: 1 2 3 4 5 9 2 6
I am trying to understand how to use SyndicationItem to display feed which is

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.