简体   繁体   中英

Trying to get rid of scrollbars in Chrome after window.resizeTo

My application uses a popup window for users to submit a Tweet through Twitter OAuth. Here's the flow:

For users not connected/auth'ed to Twitter: 1. Popup prompting to connect to Twitter.
2. Resize the popup window and redirect to Twitter auth 3. Upon success, resize window to smaller size and show Tweet popup window

In steps 2 and 3, I'm using window.resizeTo in the BODY onload event to make the window fit the content nicely and not show scrollbars. In Step 2, it makes the popup bigger to accommodate the Twitter auth form, and in 3 it makes the popup smaller to match my Tweet form.

<body onload="window.resizeTo(526,337);">

Now, this all works just fine in IE and Firefox, but in Chrome, when I get to Step 3, there are horiz and vertical scrollbars on the popup window IF I'm coming from the Twitter auth in Step 2. If I refresh the exact same popup in Step 3 in Chrome, the scrollbars disappear.

Also, if the user is already auth'ed by Twitter, I go directly to Step 3, and in this case, there are no scrollbars either.

Is there something about the redirect to or back from an external site (Twitter) that causes this? Any ideas how to get rid of the scrollbars?

Have you tried CSS? In the popup window:

body {
  overflow: hidden;
}

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