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

  • Home
  • SEARCH
  • 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 7406541
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T05:34:27+00:00 2026-05-29T05:34:27+00:00

..got a tiny little problem with mouse position after resizing browser window. I have

  • 0

..got a “tiny little” problem with mouse position after resizing browser window.
I have a form which is displayed on a click event and positoned by script as follows:

$('#whatever').click(function(event){
   $('#dialog').css('left', event.pageX);
   $('#dialog').css('top', event.pageY);
});

Works fine so the dialog apears on left top of current mouse position.
If I now resize the windows while the dialog is shown, it looses “orientation” 🙂
So I need to refresh to the current mouseposition on

$(window).resize(function(event){
   $('#dialog').css('left', event.pageX);
   $('#dialog').css('top', event.pageY);
});

But guess what, this does not work. How can I get the position without having a
mousemove or click just after having resized the window – is that possible?

Here is a jsfiddle sample to try out: jsfiddle

Thanks a lot

  • 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-29T05:34:27+00:00Added an answer on May 29, 2026 at 5:34 am

    Raising the click event onResize might work. Try this:

    $(window).resize(function(){
       $(document).trigger('click'); 
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a tiny (I hope) problem again, and I don't know how to
ive got a really weird problem. i have no clue why its not working.
I got a tiny problem. First time I am doing a UL menu with
I've got a tiny bit of code to display a file in app.yaml -
Got a bluescreen in windows while cloning a mercurial repository. After reboot, I now
Got a problem with ADOMD.NET 8.0, SQL2008 and our app. It isn't giving us
Got a bit of a mind freeze at the moment. I have the following
Got a requirement to rebuild mssql full-text index. Problem is - I need to
I've got a tiny model (let's call it Node) that represents a tree-like structure.
Does anybody have an example of spliting a html string (coming from a tiny

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.