html - 单击窗口特定部分的菜单栏按钮后,我们如何打开 Html 页面?
问题描述
单击菜单后,特定的 html 页面应该在窗口的一部分上打开我如何使用 div 标签来做到这一点?你能告诉我一些例子吗?现在我在 Frame 标签的帮助下执行此操作,但还有另一种选择,在此先感谢。
解决方案
如果我理解正确,您想通过单击按钮在页面上打开一个带有 html 的弹出窗口,您可以这样做
function openHtml()
{
document.getElementById("html_block").innerHTML = "YourHTML..."; //simple way
//$("#target_div").load("YOUR_PAGE.html"); //you can also use this to load html from file using jquery
}
.main_page
{
width: 100%;
height: 200px;
background: grey;
position: relative;
}
#html_block
{
position: absolute;
background: red;
left: 80%; /*your specific position*/
bottom: 10px;
}
<div class="main_page">
<button onclick="openHtml()">open html</button>
<div id="html_block"></div>
</div>
推荐阅读
- amazon-web-services - Redshift Unload:仅在第一个分区中添加标头,不包括其余部分
- antivirus - 从命令行允许文件 Symantec Endpoint Protection
- semantic-web - json-ld:引用模式的详细信息:Person
- javascript - JSON - Select2 数据格式
- javascript - Transfer file between servers
- c# - WPF pass reference of controls to user control
- c# - Unity main thread freeze with NetworkStream.ReadAsync?
- mysql - update SQL statement if only exist a record in a table
- c# - MimeKit 偏移量 37 处的意外令牌
- xquery - multiple statements in if condition in xquery