html - 你如何制作那些新奇的弹出窗口?

标签 html popup

<分区>

如何制作那些新奇的弹出窗口,Web 2.0亲切,例如网站要您进行调查或捐款时?更重要的是,它们叫什么?

最佳答案

我将这些称为弹出窗口,以区别于通常被视为独立浏览器窗口的弹出窗口DIV 覆盖 是另一个好词。

如何制作它们?如果你不需要在它后面做全屏阴影,而且你不需要在 IE6 中覆盖 Flash 或下拉菜单,这真的很简单。它只是一个绝对定位的DIV。假设您的页面中有这样一个 DIV:

<div style="display:none" class="survey">
    <h1>Take the annoying survey please</h1>
    <form>
    <ol>
        <li>
             Did this survey popover annoy you so much you'll never visit
             this site again and you'll click X to delete the result
             from the Google search that brought you here?<br>
             <input type="checkbox" value="yes" id="hellyes">
                 <label for="hellyes">Yes</label><br>
             <input type="checkbox" value="no" id="nope">
                 <label for="nope">Nope</label><br>
             <input type="submit">
       </li>
    </ol>
    </form>
</div>

要将其显示为弹出窗口,您只需为其提供以下 CSS:

display:block; position:absolute;
top:100px; left:300px; width:300px;
border:2px solid black;
/* Add fancier styling here */

关于html - 你如何制作那些新奇的弹出窗口?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1978364/

相关文章:

modal-dialog - 在 JHipster 5.0.0 或更高版本中创建一个类似于 LoginModal Popup 的 CustomUpdate Modal Dialog

javascript - 使用javascript自动最小化窗口 - jquery

javascript - JQUERY:在多个输入字段上应用相同的功能

html - CSS 形式 :valid selector doesn't work in IE11

javascript - 单击 Canvas 中的某个区域时如何运行特定功能

WPF 弹出窗口夺走了所有者的焦点

java - 对于没有名称的弹出窗口,弹出窗口名称为 ="window"的 waitForPopUp 方法的奇怪行为?

javascript - 弹出div的位置随滚动而改变

javascript - body.style.backgroundColor 和 window.getComputedStyle(body).getPropertyValue ('background-color' 的区别)

javascript - 我可以使用动态创建的 ID 设置 <div> 吗?