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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:11:07+00:00 2026-05-18T20:11:07+00:00

// CSS #popupUser{width:180px; height:180px; position:absolute; background:#FFFFFF; border:#000000 2px solid; display:none;} .viewUser{width:173px; float:left; padding:10px; margin-left:20px;

  • 0
// CSS
#popupUser{width:180px; height:180px; position:absolute; background:#FFFFFF; border:#000000 2px solid; display:none;}
.viewUser{width:173px; float:left; padding:10px; margin-left:20px; margin-bottom:20px; border:#000000 1px solid;}    

// HTML + Jquery
<body>  
    <div class="contenitore">   
        <script type="text/javascript">
            $(document).ready(function() {      
                $(".viewUser")
                    .mousemove(function (e) {
                        if($("#popupUser").css('display')=='none') {
                $("#popupUser").css({left:e.pageX+15, top:e.pageY -190}).show();
                            alert("None");
                        }
                    })
                    .mouseout(function () {
                    $("#popupUser").hide();
                });         
            });
        </script>      

        <div class="viewUser">
            Content
        </div>
    </div>  

    <div id="popupUser">&nbsp;</div>
</body>     

What i’d like to aspect is that, when i go on the div viewUser with the mouse, the alert is showed (printing none). After this, until I’ll left that div, I must never seen another alert (because the display property, when I call the .show() function, should be setted as block).

But that’s not happens : in fact some time (when I still moving on the viewUser with the mouse) I see the alert. Why this behaviour?

Cheers

UPDATE

In fact what i’d like to do is this : when i go on the mouse in the viewUser div, i’ll do an ajax call to the server to get some info and append it to popupUser. So, i won’t to call this ajax call everytime i move the mouse on the div 🙂

  • 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-18T20:11:07+00:00Added an answer on May 18, 2026 at 8:11 pm

    Because when the popup appears and the mouse is on it, the mouseout of the .viewUser fires and closes it again..

    If you want to track the element then reposition it in relation to the mouse.

            $(document).ready(function() {      
                $(".viewUser")
                    .mousemove(function (e) {
                        var $popU = $("#popupUser");
                        if($popU.css('display')=='none') {
                            $popU.show();
                        }
                        $popU.css({left:e.clientX+2, top: e.clientY-2});
                    })
                    .mouseout(function () {
                    $("#popupUser").hide();
                });         
            });
    

    demo: http://www.jsfiddle.net/gaby/RQhTp/


    The solution (after comments) is to use a timeout for the mouseout so that the div has enough time to re-position itself..

            $(document).ready(function() {      
                $(".viewUser")
                    .mouseenter(function(e){
                        $("#popupUser").show().css({left:e.clientX+1, top: e.clientY+1});
                         clearTimeout($(this).data('timeout'));
                    })
                    .mousemove(function (e) {
                        $("#popupUser").css({left:e.clientX+1, top: e.clientY+1});
                    })
                    .mouseleave(function() {
                        $(this).data('timeout', setTimeout(function(){
                            $("#popupUser").hide();
                        }, 100));
    
                });         
            });
    

    demo: http://www.jsfiddle.net/gaby/RQhTp/3/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

// CSS #popupUser{width:180px; height:180px; position:absolute; background:#FFFFFF; border:#000000 2px solid; display:none;} .viewUser{width:173px; float:left; padding:10px; margin-left:20px;
CSS: .jC2_Container{ } .jC2_EventWrapper { border-right:1px solid #CDC3FF; height:20px; width:250px; } .jC2_EventNum { float:left;
CSS: .events_holder { width:100%; background-color: #d9ceae; } .events_holder .event_holder { width:100%; float: left; min-height:
CSS #acc-close-all, #to-top { position: relative; left: 951px; width: 29px; height: 42px; margin-bottom: 2px;
The CSS rules visibility:hidden and display:none both result in the element not being visible.
CSS: #outer{ background-color:#FFFF99; } #inner1{ float : left; } .New1{ width: 62%; } .New2{
CSS: .divIm { border:1px solid red; } , and code-line var borderColor = $(this).css(border-color)
My CSS looks like this: #menu { width: 1024px; height: 25px; margin: 0 auto;
CSS #web { position:absolute; left:26%; top: 60%; HTML <div class=web> HI </div> I don't
Using CSS, I'm trying to specify the height of a span tag in Firefox,

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.