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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:00:44+00:00 2026-06-14T04:00:44+00:00

I cannot get this code to work – what I want is that when

  • 0

I cannot get this code to work – what I want is that when I hover over the circle the menu appears then if I move the mouse off the circle or menu it disappears. Anything I try and do is VERY buggy, such as onmouseover on circle and then onmouseout on menu the menu seems to disappear after I leave the circle, I have tried using other constructs than Divs but still no luck, at a loss I decided to post here to see if anyone can help. Please find code below:

JS:

<script>

function circleAnimOn() {
    //show menu
    document.getElementById("cssmenuDiv").style.display="block";
    document.getElementById("cssmenuDiv").style.visibility="visible";
}

function circleAnimOff() {
    //hide menu
    document.getElementById("cssmenuDiv").style.display="none";
    document.getElementById("cssmenuDiv").style.visibility="hidden";
}
</script>

HTML:

<body>

<div class="divCircle" id="divCircle" onMouseOver="circleAnimOn();">
</div>

<div class="cssmenuDiv" id="cssmenuDiv"><!-- cssmenuDiv -->

<div id='cssmenu'>
<ul>
   <li class='active '><a href='index.html'><span>Home</span></a></li>
   <li class='has-sub '><a href='#'><span>Products</span></a>
      <ul>
         <li class='has-sub '><a href='#'><span>Product 1</span></a>
            <ul>
               <li><a href='#'><span>Sub Item</span></a></li>
               <li><a href='#'><span>Sub Item</span></a></li>
            </ul>
         </li>
         <li class='has-sub '><a href='#'><span>Product 2</span></a>
            <ul>
               <li><a href='#'><span>Sub Item</span></a></li>
               <li><a href='#'><span>Sub Item</span></a></li>
               <li><a href='#'><span>Sub Item</span></a></li>
            </ul>
         </li>
      </ul>
   </li>
   <li><a href='#'><span>About</span></a></li>
   <li><a href='#'><span>Contact</span></a></li>
</ul>
</div>

</div><!-- cssmenuDiv -->

CSS:

body {

  text-align:center;
}

#divCircle
{
    width:30px;
    height:30px;
    background-color:#CCC;
    margin-left:auto;
    margin-right:auto;
border:2px solid;
border-radius:25px;
-moz-border-radius:25px; /* Firefox 3.6 and earlier */
} 

#divCircle:hover {
    background-color:#093;  
}

#circle { width: 50px; height: 50px; background: red; -moz-border-radius: 50px; -webkit-border-radius: 50px; border-radius: 50px;}

.cssmenuDiv {
    display:none;
    visibility:hidden;
    margin-left:750px;

}

/* Some stylesheet reset */
#cssmenu > ul{
    list-style: none;
    margin: 0;
    padding: 0;
    vertical-align: baseline;
    line-height: 1;
}

/* The container */
#cssmenu > ul {
    display: block;
    position: relative;
    width: 150px;
}

    /* The list elements which contain the links */
    #cssmenu > ul li {
        display: block;
        position: relative;
        margin: 0;
        padding: 0;
        width: 150px;   
    }

        /* General link styling */
        #cssmenu > ul li a {
            /* Layout */
            display: block;
            position: relative;
            margin: 0;
            border-top: 1px dotted #fff;
            border-bottom: 1px dotted #d9d9d9;
            padding: 11px 20px;
            width: 110px;

            /* Typography */
            font-family:  Helvetica, Arial, sans-serif;
            color: #3dafea;
            text-decoration: none;
            text-transform: uppercase;
            text-shadow: 0 1px 0 #fff;
            font-size: 13px;
            font-weight: 300;

            /* Background & effects */
            background: #eaeaea;
        }

        /* Rounded corners for the first link of the menu/submenus */
        #cssmenu > ul li:first-child>a {
            border-top-left-radius: 4px;
            border-top-right-radius: 4px;
            border-top: 0;
        }

        /* Rounded corners for the last link of the menu/submenus */
        #cssmenu > ul li:last-child>a {
            border-bottom-left-radius: 4px;
            border-bottom-right-radius: 4px;
            border-bottom: 0;
        }


        /* The hover state of the menu/submenu links */
        #cssmenu > ul li>a:hover, #cssmenu > ul li:hover>a {
            color: #fff;
            text-shadow: 0 1px 0 rgba(0, 0, 0, .3);
            background: #54cdf1;
            background: -webkit-linear-gradient(bottom, #54cdf1, #74d7f3);
            background: -ms-linear-gradient(bottom, #54cdf1, #74d7f3); 
            background: -moz-linear-gradient(bottom, #54cdf1, #74d7f3);
            background: -o-linear-gradient(bottom, #54cdf1, #74d7f3);
            border-color: transparent;
        }

        /* The arrow indicating a submenu */
        #cssmenu > ul .has-sub>a::after {
            content: '';
            position: absolute;
            top: 16px;
            right: 10px;
            width: 0px;
            height: 0px;

            /* Creating the arrow using borders */
            border: 4px solid transparent;
            border-left: 4px solid #3dafea; 
        }

        /* The same arrow, but with a darker color, to create the shadow effect */
        #cssmenu > ul .has-sub>a::before {
            content: '';
            position: absolute;
            top: 17px;
            right: 10px;
            width: 0px;
            height: 0px;

            /* Creating the arrow using borders */
            border: 4px solid transparent;
            border-left: 4px solid #fff;
        }

        /* Changing the color of the arrow on hover */
        #cssmenu > ul li>a:hover::after, #cssmenu > ul li:hover>a::after {
            border-left: 4px solid #fff;
        }

        #cssmenu > ul li>a:hover::before, #cssmenu > ul li:hover>a::before {
            border-left: 4px solid rgba(0, 0, 0, .25);
        }


        /* THE SUBMENUS */
        #cssmenu > ul ul {
            position: absolute;
            left: 150px;
            top: -9999px;
            padding-left: 5px;
            opacity: 0;
            /* The fade effect, created using an opacity transition */
            -webkit-transition: opacity .3s ease-in;
            -moz-transition: opacity .3s ease-in;
            -o-transition: opacity .3s ease-in;
            -ms-transition: opacity .3s ease-in;
        }

        /* Showing the submenu when the user is hovering the parent link */
        #cssmenu > ul li:hover>ul {
            top: 0px;
            opacity: 1;
        }

Thanks in advance for any help!

  • 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-14T04:00:45+00:00Added an answer on June 14, 2026 at 4:00 am

    Heres an example…

    http://jsfiddle.net/5hnDn/5/

    Forget about the js, not required…

    <div class="divCircle" id="divCircle">
    <div id='cssmenu'>    
    <ul>
       <li class='active '><a href='index.html'><span>Home</span></a></li>
       <li class='has-sub '><a href='#'><span>Products</span></a>
          <ul>
             <li class='has-sub '><a href='#'><span>Product 1</span></a>
                <ul>
                   <li><a href='#'><span>Sub Item</span></a></li>
                   <li><a href='#'><span>Sub Item</span></a></li>
                </ul>
             </li>
             <li class='has-sub '><a href='#'><span>Product 2</span></a>
                <ul>
                   <li><a href='#'><span>Sub Item</span></a></li>
                   <li><a href='#'><span>Sub Item</span></a></li>
                   <li><a href='#'><span>Sub Item</span></a></li>
                </ul>
             </li>
          </ul>
       </li>
       <li><a href='#'><span>About</span></a></li>
       <li><a href='#'><span>Contact</span></a></li>
    </ul>
    </div>
    </div>
    

    …

    Only the changes to rules shown below…

    #divCircle {
        position: relative;
    } 
    
    #divCircle:hover #cssmenu {
        display: block;
    }
    #cssmenu {
        position: absolute;
        top: 30px;
        left: -60px;
    }
    
    #cssmenu > ul{
        padding: 10px 0 0 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I cannot get this to work, here is code that I found in another
Hey guys I simply cannot get this to work. I have some content that
I am trying to get this code to work but cannot seem to get
I cannot get this (http://plugins.jquery.com/project/autogrowtextarea) jquery plugin to work. below is my code. I
Somehow, I cannot get this piece of Smarty code to work as required: {assign
I just cannot get this to work, would appreciate if someone can help. So
Ok, I've tried about near everything and I cannot get this to work. I
Im new to data binding in Windows Phone 7 and cannot get this code
I know this is embarrassing easy but I cannot get this to work right
Cannot get this to work. First time using variables passed into functions. Unchecking radio

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.