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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:24:46+00:00 2026-05-25T03:24:46+00:00

I want to display a pop up window (div) using jquery animate (‘top’ and

  • 0

I want to display a pop up window (div) using jquery animate (‘top’ and ‘left’ according to the user loaction )

I want this popup (top position) to be display according to the user location in the page(if the user scroll down the page ,the poup will be display in the user’s location on this page)

I tried to take the mouse coordinates,in firefox it works fine, since the location of the mouse is absolote to the top of the screen,but in IE the coordinate of the mouse is relative to the top of the screen where the user’s location is.

this is the code for taking the mouse coordinate

function getMouseXY(e) {

if (IE) { // grab the x-y pos.s if browser is IE
tempX = event.clientX + document.body.scrollLeft;

tempY = event.clientY + document.body.scrollTop;

} else { // grab the x-y pos.s if browser is NS
tempX = e.pageX;
tempY = e.pageY;
}
// catch possible negative values in NS4
if (tempX < 0) { tempX = 0 }
if (tempY < 0) { tempY = 0 }

}

How can I use the animate top and left, relative to the user location in IE?

Thanks for any help

  • 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-25T03:24:46+00:00Added an answer on May 25, 2026 at 3:24 am

    You don’t need to know mouse pointer position if you can detect window size un scrollbar state.

    function getPosition(){
      var width = 100; // popup width
      var height = 100; // popup height
    
      return {
        top: (($(window).height()-height)/2)+$(document).scrollTop(),
        left: (($(window).width()-width)/2)+$(document).scrollLeft()
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make a jQuery based custom popup window for my site using
i want to use facebook's fb:dialog tag to display a simple pop-up form for
i want to display some information in a listview using the GridView. i have
I am developing a Windows application in which I want to display a pop-up
i am creating a pop-up window and i want to show the contents of
I have an image on clicking it deletes a user ,i want to display
I want to display a dialog when a user mouses over a certain image.
I have a simple quiz application and I want display a nice timer /
I want to display the TIME field from my mysql table on my website,
I want to display tabular type data, but it will not be coming from

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.