Javascript 如何通过模式弹出窗口模拟浏览器?

Javascript 如何通过模式弹出窗口模拟浏览器?,javascript,popup,Javascript,Popup,正如标题所示,我想通过我网站上的模式弹出窗口来模拟浏览器(或窗口程序)。它不需要是可拖动的或可调整大小的,我只是在弹出窗口周围制作这个“框架”时遇到问题,所以你滚动内容,顶部(带有关闭的“X”图标和“程序”-名称)也不会滚动 有什么建议吗?如果我理解正确,您想显示一个弹出窗口,其中包含一个可滚动框架,带有关闭按钮,并且标题部分不滚动 您可以在此处使用html和css()创建弹出窗口。如果需要,您可以轻松地将iframe更改为普通内容div html代码 高级选项 如果您需要更高级的选项,如不滚动

正如标题所示,我想通过我网站上的模式弹出窗口来模拟浏览器(或窗口程序)。它不需要是可拖动的或可调整大小的,我只是在弹出窗口周围制作这个“框架”时遇到问题,所以你滚动内容,顶部(带有关闭的“X”图标和“程序”-名称)也不会滚动


有什么建议吗?

如果我理解正确,您想显示一个弹出窗口,其中包含一个可滚动框架,带有关闭按钮,并且标题部分不滚动

您可以在此处使用html和css()创建弹出窗口。如果需要,您可以轻松地将iframe更改为普通内容div

html代码 高级选项 如果您需要更高级的选项,如不滚动背景主体、非全屏弹出、居中等,您可以签出弹出插件。您可以查看我的jquery插件的示例代码,或者有许多其他插件可用于其他选项

<div id="popup" style="display:none;">
    <div class="overlay"></div>
    <div class="box">
        <div class="close">x</div>
        <div class="frame">
            <div class="title">Title</div>
            <iframe src="http://doc.jsfiddle.net/"></iframe>
        </div>
    </div>
</div>
/* full screen dark overlay */
 .overlay {
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.6);
    width: 100%;
    height: 100%;
}
/* full screen popup */
 .box {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
/* round black close button */
 .close {
    /* at the top right */
    position: absolute;
    top: 30px;
    right: 30px;
    z-index: 102;
    /* in front of the frame */
    /* round black */
    width: 20px;
    height: 20px;
    -webkit-border-radius: 20px;
    border-radius: 20px;
    background-color: #000;
    color:#fff;
    cursor: pointer;
    text-align:center;
}
/* contains the title and frame */
 .frame {
    position: absolute;
    top: 20px;
    right: 20px;
    bottom: 20px;
    left: 20px;
    z-index: 100;
}
/* The title */
 .frame .title {
    background-color: #fff;
    padding:10px;
}
/* The iframe for your content */
 .frame iframe {
    width: 100%;
    height: 400px;
    border: none;
}