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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T15:28:29+00:00 2026-05-25T15:28:29+00:00

I am using this HTML: <div class=menu> <ul> <li><a href=# name=div1 >Home</a></li> <li><a href=#

  • 0

I am using this HTML:

<div class="menu">
    <ul>
        <li><a href="#" name="div1" >Home</a></li>
        <li><a href="#" name="div2" >Page1</a></li>
        <li><a href="#" name="div3" >page2</a></li>
        <li><a href="#" name="div4" >page3</a></li>
    </ul>
</div>

<div>

    <div class="div1" style="display:none">
        Test
    </div>

    <div class="div2" style="display:none">
        Test...
    </div>

    <div class="div3" style="display:none">
        Test 1
    </div>

    <div class="div4" style="display:none">
        Test 2
    </div>

</div>

Along with the following jQuery:

$('a').mouseover

(function() {
    var divname = this.name;
    $("." + divname).show("slow");
});

JsFiddle

I want to be able to mouseout and hide once I leave the boxes that appear not on “a”. How do I do this?

  • 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-25T15:28:30+00:00Added an answer on May 25, 2026 at 3:28 pm

    Wow Im sorry I didnt understand the question initially I guess, see below. This binds mouseout to the div you just showed, so it will stay until you move out of it, not the a.

    Live Demo

    $('a').mouseover(function() {
        var divname = this.name;
        $("." + divname).show("slow").mouseout(function(){$(this).hide('slow')});
    });
    

    I would recommend changing your markup however to have the div’s as children of the li’s, or at the very least, putting them closer to the a’s once hovered over because if you notice you can hover over all of the a elements but never mouseout of the div causing them to stay. Then you could do something like the following:

    $('li').hover(function() {
        var divname = this.name;
        $("." + divname).show("slow");
    },function(){
        var divname = this.name;
        $("." + divname).hide("slow");
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following HTML: <div class=menu> <a class=main-nav-item href=home>home</a> <a class=main-nav-item-current href=business>business</a> <a
<div class="menu_item_variant" id="date" onmouseover="mouseIn(this.id)" onmouseout="mouseOut(this.id)"> <a href="dating-advice.html">Dating Coaching &amp; Advice</a> </div> hi, could some
Consider the following HTML structure for drop-down menu: <ul class=tabMenu> <li><a href=#>Games</a> <div id=sub>
I am using this HTML <html> <head> <Title>EBAY Search</title> </head> <script language=JavaScript src=ajaxlib.js></script> <body>
I'm using this HTML,CSS and Javascript code (in one document together if you want
i'm using this example implementation found at http://tangentsoft.net/wskfaq/examples/basics/select-server.html This is doing most of what
I am creating a select box for a form using this in _form.html.erb <%=
I am using this workflow: http://reinh.com/blog/2009/03/02/a-git-workflow-for-agile-teams.html where he mentions: First, and while in your
I have this HTML: <select multiple='multiple' size='3'> <option>1</option> <option>2</option> <option>3</option> <option>4</option> <option>5</option> </select> Using
How to set entire HTML in MSHTML? I am trying using this assignment: (Document

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.