【发布时间】:2010-11-25 09:14:29
【问题描述】:
我正在使用 CSS 选择器为 Web 模板生成自定义弹出窗口 - 基本上,有些制作者对 JS 不满意,我需要一种简单的方法让他们设置弹出窗口大小等。我'我对这种方法的优点并不真正感兴趣,而是希望了解为什么 jquery 似乎无法获得 CSS 中为 Safari 中的锚定义的宽度和高度。
见:http://f1shw1ck.com/jquery_sandbox/csspops.html
我的问题的实质:
对于选择器a.popup {width: 800px;height: 560px;}和锚<a href="http://www.metmuseum.org/toah/hd/apol/hd_apol.htm" class="popup">African Rock Art: Apollo 11 Cave Stone (c. 25,500 - 23,500 BCE)</a>为什么是
if ($(this).css("width")) {
windowParams.width = $(this).css("width");
}
if ($(this).css("height")) {
windowParams.height = $(this).css("height");
}
两个属性在 Safari 中都返回为零?
其他浏览器中的onclick弹出警报:toolbar=no,directories=no,location=no,resizable=yes,menubar=no,scrollbars=yes,status=no,width=800px,height=560px,top= 20,左=240
Safari 中的警报:工具栏=no,directories=no,location=no,resizable=yes,menubar=no,scrollbars=yes,status=no,width=0px,height=0px,top=20,left=640
感谢您帮助我理解。
【问题讨论】: