DHTML 弹出窗口
我正在尝试在我的网站上创建一个 DHTML 窗口,并且实际上可以让它为我弹出。我遇到的问题是,当它弹出时,它会在页面上移动文本。我见过 DHTML 弹出窗口的示例,但这种情况不会发生,例如: http://dhtmlpopups.webarticles .org/basics.php 或此处:http://www .php-development.ru/javascripts/popup-window.php
我不知道我做错了什么,我的弹出窗口的 div 标签看起来像这样
<div id="loginPopup" style="position: relative; display:none; z-index: 500;"><div class="closeButton" onClick="javascript:document.getElementById('loginPopup').style.display = 'none';"></div></div>
我的网站还使用我从网上获取的模板和 css ,这可能是问题所在吗?我不知道如何纠正这个问题,任何帮助都会很棒。
谢谢!
I am trying to make a DHTML window on my website and I can actually get it to popup for me. The problem I am having with it is when it pops up it moves the text around on the page. I have seen examples of DHTML popups where this doesn't occur for instance here: http://dhtmlpopups.webarticles.org/basics.php or here: http://www.php-development.ru/javascripts/popup-window.php
I cant figure out what I am doing wrong the div tag for my popup looks like this
<div id="loginPopup" style="position: relative; display:none; z-index: 500;"><div class="closeButton" onClick="javascript:document.getElementById('loginPopup').style.display = 'none';"></div></div>
My site also use a template and css that I got off the net, could that be the problem? I am at a loss for what to do to correct this, any help would be awesome.
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您希望将 div 定位为“绝对”而不是“相对”。然后,我将使用“顶部”和“左侧”属性来定位窗口。
You want to position the div as 'absolute' not 'relative.' I would then use the 'top' and 'left' attributes to position the window.
如果您不希望它移动其他元素,请使用绝对定位。
use absolute positioning if you don't want it to move your other elements.