简体   繁体   中英

How to prevent firefox from scrolling to the bottom of the page when a large popup is opened

I use a simple onClick event to display a popup in my application. When the popup size is large, the screen is automatically scrolled down to the bottom of the page after the popup appears. I am only facing this problem in Firefox browser. Any help would be appreciated.

From the design and usability perspective you should not allow any pop-up on your web page to exceed the given view-port limit, for example half of the window height.

Try to make the pop-up div with fixed height and with overflow-y: scroll , so if there is more content - the user will be able to scroll down and read it.

In general, you should use Pop-ups carefully.

Unfortunately, the bad pop-ups give all pop-ups a bad name. Some users even turn off JavaScript in their browsers or download special software utilities to kill all pop-up windows.

Many do this in desperation because pop-up windows are stalking them wherever they go on the Web - and most people don't realize that they are partly to blame. Often, they've downloaded some free utility or music-sharing program that contains a scum-ware program that tracks your movements online, steals your personal information, and makes your online life miserable by continually harassing you with pop-up advertising!

See this , this article and this SO question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM