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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:10:28+00:00 2026-05-18T02:10:28+00:00

What I’m trying to do is, I have a div box with a link

  • 0

What I’m trying to do is, I have a div box with a link (link 1). It an “a href” inside a div with no title so you can click on the whole div. What I want is for this to behave the way it does but also expand and reveal two more links when you hover over it (link 2 and 3) and hide when you mouseout.

https://i.stack.imgur.com/83rV2.png

The closest I’ve gotten is this bit of code.

Java:

<script type="text/javascript">
function showhide(id, visibility) {
document.getElementById(id).style.display = visibility;
}
</script>

CSS:

<div id="button"> <a href='/page' onMouseOver="showhide('divContent','inline');"
onMouseOut="showhide('divContent','none');"
onfocus="showhide('divContent','inline')";
onBlur="showhide('divContent','none')";></a> <div id="divContent">Link</div>
</div>

Problem with this is, the divContent div disappears when I go to it because I’m not in the button div anymore.

Can anyone help?

EDIT

Thank you Moin Zaman, you answer covers about 90% of what I was looking for. One partular thing I need out of this is I need the entire original div to be clickable, aside from the area where link1 and link2 appear. The reason for this is, link 1 is a fixed size div box with a background image and no text. The hover state changes the background to a hover version of that 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. Editorial Team
    Editorial Team
    2026-05-18T02:10:29+00:00Added an answer on May 18, 2026 at 2:10 am

    Try this: http://jsbin.com/ohope4/3

    <!doctype html>
    <html>
    <head>
      <title></title>
      <style type="text/css">
        html,body,h1,h2,h3,h4,h5,p,ul,li,form,button { margin:0; padding:0 }
        body { font:normal 62.5% arial; margin:20px }
        #button { background:#808080; padding:25px 10px 5px 10px; width:80px; text-align:center; }
        #button a { text-transform:uppercase; text-decoration:none; font-size:1.2em; color:#000; }
        #link2,#link3 {display:none; font-size:0.9em;}
        #link1 { display:block; text-align:center; padding-bottom:25px }
      </style>
    </head>
    <body>
    
        <div id="button">
            <a id="link1" href="#">link 1</a>
            <a id="link2" href="#">link 2</a>
            <a id="link3" href="#">link 3</a>        
        </div>
    
    <script type="text/javascript">
    
        window.onload = function() {
            var divButton = document.getElementById("button");
            divButton.onmouseover = ShowLinks;
            divButton.onmouseout = HideLinks;
        };  
    
      function ShowLinks(){
        document.getElementById('link2').style.display = 'inline';
        document.getElementById('link3').style.display = 'inline';
      }
      function HideLinks(){
        document.getElementById('link2').style.display = 'none';
        document.getElementById('link3').style.display = 'none';  
      }  
    </script>
    </body>
    </html>​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.