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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:01:52+00:00 2026-06-13T21:01:52+00:00

Ok, my question is simple, though I am unsure if the answer will be.

  • 0

Ok, my question is simple, though I am unsure if the answer will be. I have an element that is fixed to the bottom of the browser window. When it is unneeded I want to hide it(set height to 0px). When the user’s mouse is X units away from the bottom of the WINDOW (not document) I want to show the div again. I googled a bit and all I could find was information on triggering events/preforming actions when the page was scrolled to X units away from the bottom. I need not the exact code of how to do this, if I could just be pointed into the right direction.

The question(for those that didn’t see it):
How to fire an event/execute a function when the mouse pointer is within X units from the bottom of the browser window(not document)?

A few notes:
This is for a greasemonkey/userscript so answers need not apply to IE.
Please do not suggest the usage of a library. For something as small as this, requiring an entire library is not an answer I am willing to accept.

ANSWER:
Building off of Kir lvlev’s answer below(Remember to give his answer an upvote):

// Standards compliant browsers
// if you have an IE solution, post it in the comments and I will add it.
window.addEventListener("mousemove",function(e) {
    // 20 is the number of pixels from the bottom inwhich the action should be preformed
    if ((this.innerHeight - 20) <= e.clientY) {
        //do stuff
    }
});
  • 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-13T21:01:53+00:00Added an answer on June 13, 2026 at 9:01 pm

    use mousemove event handler

    $(window).mousemove(function(e)
    {
          //mouse coordinates: e.pageX e.pageY
          //window height $(window).height()
    });
    

    non-jquery:

    window.onmousemove = function(e) {
      //e.clientX e.clientY
      //window.innerHeight
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rather simple question. I can't find an answer by searching though.
I have a question that may be simple for you to answer I have
I have a rather simple threading question. I'm writing a simple utility that will
Simple question here (though perhaps not such a simple answer): Is it possible to
I have a simple question. I want to have a StageWebView inside a MovieClip
I have a quite simple question: I want to have a Java Class, which
Pretty simple question, perhaps not so simple answer though: I've got a clear view
I have got a question on regular expression. Though simple, I got some contracting
I've got a simple question. In Objective-C, when you have a method you want
My question is simple but though I didn't found a precise answer on the

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.