1

I have been trying to figure out the following problem for way too long now and I can't seem to get a grip on what I'm doing wrong...

For my online portfolio, I have a splash "enter" image that is supposed to open a new window with a fixed size of 1013px for the width and 632px for the height. I chose this size for the window because this is the size of my background image and I am not intending on making the actual page scrollable. All of my content is supposed to just fit within the fixed window.

However, I'm noticing discrepancies among browsers. On my very own computer, a Macbook Pro, using a recent version of Safari, I keep on getting about 80+ pixels of white space underneath my background. On my girlfriend's computer, (also a Macbook Pro,) this problem also occurs. But, when I test the website on my iMac desktop, which happens to have Safari, Chrome, and Firefox all installed, the window opens up to the correct dimensions, with no extra white space. Finally, although I haven't been able to see it functioning in person, I've been told that there is white space added at the bottom AND on the right side of my background when the website is opened up on a Windows-based computer.

The link to the splash page is: http://www.jamesbarracca.com

Can you please tell me why I am having this issue? Thank you!

4

1 回答 1

0

我建议更改您的 JavaScript 以更严格地控​​制弹出窗口的大小。可能发生的情况是,在各种不同的浏览器和不同的机器上,弹出窗口的默认大小是不同的。

看看这篇文章的例子。

摘录:

<script type="text/javascript">
    function openpopup(address, width, height) {
        window.open(
            address, 
            "",
            "fullscreen=no,toolbar=no,status=no," + 
            "menubar=no,scrollbars=no,resizable=no," +
            "width=" + width + ",height=" + height
        );
    }
</script>

然后,您可以使用以下内容调用此新函数:

<a href="javascript: openpopup('http://www.google.com', '1013', '632')">
  <img src="/my/image/path.png" />
</a>

如您所见 - 该功能允许您指定弹出窗口的宽度和高度,关闭滚动条/调整大小等功能。希望能帮助到你!

于 2012-11-29T21:53:37.757 回答