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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:16:52+00:00 2026-06-15T22:16:52+00:00

I have the following jQuery code (take from another question somewhere here): $(document).ready(function(){ $(#profile_dropdown).mouseenter(function(){

  • 0

I have the following jQuery code (take from another question somewhere here):

$(document).ready(function(){
    $("#profile_dropdown").mouseenter(function(){
        clearTimeout($(this).data('timeoutId'));
        $("#profile_dropdown_content").fadeIn("slow");
    }).mouseleave(function(){
        var someElement = $("#profile_dropdown");
        var timeoutId = setTimeout(function(){
            $("#profile_dropdown_content").fadeOut("slow");
        }, 650);
        //set the timeoutId, allowing us to clear this trigger if the mouse comes back over
        someElement.data('timeoutId', timeoutId); 
    });
});

It works as expected, however – I can’t figure out how to keep the #profile_dropdown_content shown if the mouse is moved over it. And how to make it fadeOut if the mouse moves out of course…

Any ideas?

  • 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-15T22:16:53+00:00Added an answer on June 15, 2026 at 10:16 pm

    Nest the #profile_dropdown_content inside the #profile_dropdown container and use the hover event.

    jsfiddle: http://jsfiddle.net/UsWYq/1/

    JS

    $(document).ready(function(){
        $("#profile_dropdown").hover(function(){
            clearTimeout($(this).data('timeoutId'));
            $("#profile_dropdown_content").fadeIn("slow");
        }, function(){
            var someElement = $("#profile_dropdown");
            var timeoutId = setTimeout(function(){
                $("#profile_dropdown_content").fadeOut("slow");
            }, 650);
            //set the timeoutId, allowing us to clear this trigger if the mouse comes back over
            someElement.data('timeoutId', timeoutId); 
        });
    });
    

    HTML

    <div id="profile_dropdown">
        <div class="inner">Hover Me</div>
        <div id="profile_dropdown_content">Display Me</div>
    </div>
    <div id="profile_dropdown"></div>
    

    CSS

    #profile_dropdown {
        background:whitesmoke;
        float:left;
    }
    #profile_dropdown .inner {
        height:100px;
        width:100px;
    }
    #profile_dropdown_content {
        display:none;
        background:red;
        height:100px;
        width:100px;
    }
    

    Option 2

    Another thing you could do is CSS3 transitions: http://jsfiddle.net/Ezxm5/

    #profile_dropdown {
        background:whitesmoke;
        float:left;
    }
    #profile_dropdown:hover #profile_dropdown_content {
        display:block;
        opacity:1;
        height:100px;
    }
    #profile_dropdown .inner {
        height:100px;
        width:100px;
    }
    #profile_dropdown_content {
        opacity:0;
        background:red;
        height:0;
        width:100px;
        overflow:hidden;
        -webkit-transition: opacity 0.4s ease-in, height 0.4s ease-out;
        -moz-transition: opacity 0.4s ease-in, height 0.4s ease-out;
        -ms-transition: opacity 0.4s ease-in, height 0.4s ease-out;
        -o-transition: opacity 0.4s ease-in, height 0.4s ease-out;
        transition: opacity 0.4s ease-in, height 0.4s ease-out;
    }​
    ​
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following jquery code: $(document).ready(function() { $(body[class*=page-calendar-practices] #content-header h1#title).after(<div id='athletics_practice-schedule'><div id='inner-title'><a href='www.example.com'
I have the following JQuery code: <script type=text/javascript> $(document).ready(function () { var $containerHeight =
I have the following JQuery code: $(document).ready(function () { var $containerHeight = $(window).height(); if
I have the following jquery code. var destTable = $(#numbers); $(document).ready(function() { $(#btnAdd).click(function() {
I have the following jquery code: $(document).ready(function() { $(#build_table, a.coursename, .Start Date, .Book Title,
Please take a look at the following autocomplete code. $(document).ready(function(){ $(#the_input).autocomplete(/autocomplete.php, { //some options
I am using jQuery autocomplete pluggin . I have the following code $().ready(function() {
i have the following jQuery code. $(function() { $('.clickme').click(function() { $('.totalthing').slideToggle('slow','easeInOutQuart', function() { //
I have the following jquery code: jQuery(function(){ jQuery(select#rooms).change(function(){ var options = ''; jQuery.getJSON(/admin/selection.php,{id: jQuery(this).val(),
I have the following jquery code which doesn't work quite right when trying to

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.