开发者

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

开发者 https://www.devze.com 2023-01-25 13:10 出处:网络
My application uses a popup window for users to submit a Tweet through Twitter OAuth.Here\'s the flow:

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 开发者_如何学Cin 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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消