html帮助文档框架
<!DOCTYPE HTML>
<html>
<header>
<title>帮助文档</title>
</header>
<body>
<style>
body {
margin:0px;
padding:0px;
}
.leftNav {
position: fixed;
height: 100%;
width: 200px;
background: #D3D3D3;
left: 0px;
overflow-y: scroll;
}
.content {
padding-left:200px;
padding-bottom:0px;
}
.sync_height {
min-height:300px;
}
.default_li_hide {
display:none;
}
li:hover{
background:#778899;
cursor:pointer;
}
</style>
<div class="leftNav">
<ul style = "list-style: none">
<li id ="debug_doc" ><a>调试说明</a></li>
<ul style = "list-style: none" class="default_li_hide li_hover" id = "debug_doc_send_sub">
<li id ="debug_doc_send_sub_hardware_link"><a>设备硬件连接</a></li>
<li id ="debug_doc_send_sub_ui_link"><a>界面连接</a></li>
<li id ="debug_doc_send_sub_REH_ui"><a>REH界面图示</a></li>
<li id ="debug_doc_send_sub_REQ_ui"><a>REQ界面图示</a></li>
<li id ="debug_doc_send_sub_REV_ui"><a>REV界面图示</a></li>
<li id ="debug_doc_send_sub_bt_link"><a>蓝牙连接</a></li>
<li id ="debug_doc_send_sub_bt_display_link"><a>测量显示</a></li>
<li id ="debug_doc_send_sub_warring"><a>注意事项</a></li>
</ul>
<li id ="comm_proto"><a>通讯协议</a>
</li>
<ul style = "list-style: none" class="default_li_hide" id = "comm_proto_send_sub">
<li id ="comm_proto_send_sub_radar_proto"><a>雷达产品通信协议</a></li>
<li id ="comm_proto_send_sub_abstracts"><a>概述</a></li>
<li id ="comm_proto_send_sub_resi"><a>寄存器</a></li>
<li id ="comm_proto_send_sub_RW"><a>寄存器读写示例</a></li>
<li id ="comm_proto_send_sub_warring"><a>常见问题和注意事项</a></li>
</ul>
</ul>
</div>
<div class="content sync_height" id="myDiv">
<iframe id="ifrm" class="sync_height" width="100%" frameborder="0" src="./html/设备硬件连接.html" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="true" allowfullscreen="true">
</iframe>
</div>
</div>
<script>
// 获取屏幕大小并设置div样式
window.addEventListener('DOMContentLoaded', function() {
var screenWidth = window.innerWidth;
var screenHeight = window.innerHeight;
var divElement = document.getElementById("myDiv");
var iframeElement = document.getElementById("ifrm");
divElement.style.width = screenWidth-220 + "px";
divElement.style.height = screenHeight-10 + "px";
iframeElement.style.width = screenWidth-220 + "px";
iframeElement.style.height = screenHeight -10+ "px";
});
//显示书签
document.getElementById("debug_doc").addEventListener("click", function(){
var liElement = document.getElementById("debug_doc_send_sub");
if(liElement.style.display == "none")
liElement.style.display = "block";
else
liElement.style.display = "none";
});
document.getElementById("comm_proto").addEventListener("click", function(){
var liElement = document.getElementById("comm_proto_send_sub");
if(liElement.style.display == "none")
liElement.style.display = "block";
else
liElement.style.display = "none";
});
//跳转页面 调试说明
document.getElementById("debug_doc_send_sub_hardware_link").addEventListener("click", function(){
var iframeElement = document.getElementById("ifrm");
iframeElement.src = "./html/设备硬件连接.html";
});
document.getElementById("debug_doc_send_sub_ui_link").addEventListener("click", function(){
var iframeElement = document.getElementById("ifrm");
iframeElement.src = "./html/界面连接.html";
});
document.getElementById("debug_doc_send_sub_REH_ui").addEventListener("click", function(){
var iframeElement = document.getElementById("ifrm");
iframeElement.src = "./html/REH界面图示.html";
});
document.getElementById("debug_doc_send_sub_REQ_ui").addEventListener("click", function(){
var iframeElement = document.getElementById("ifrm");
iframeElement.src = "./html/REQ界面图示.html";
});
document.getElementById("debug_doc_send_sub_REV_ui").addEventListener("click", function(){
var iframeElement = document.getElementById("ifrm");
iframeElement.src = "./html/REV界面图示.html";
});
document.getElementById("debug_doc_send_sub_bt_link").addEventListener("click", function(){
var iframeElement = document.getElementById("ifrm");
iframeElement.src = "./html/蓝牙连接.html";
});
document.getElementById("debug_doc_send_sub_warring").addEventListener("click", function(){
var iframeElement = document.getElementById("ifrm");
iframeElement.src = "./html/注意事项.html";
});
document.getElementById("debug_doc_send_sub_bt_display_link").addEventListener("click", function(){
var iframeElement = document.getElementById("ifrm");
iframeElement.src = "./html/测量显示.html";
});
// 通信协议
document.getElementById("comm_proto_send_sub_radar_proto").addEventListener("click", function(){
var iframeElement = document.getElementById("ifrm");
iframeElement.src = "./html/REH、REV、REQ 系列雷达产品通信协议.html";
});
document.getElementById("comm_proto_send_sub_abstracts").addEventListener("click", function(){
var iframeElement = document.getElementById("ifrm");
iframeElement.src = "./html/概述.html";
});
document.getElementById("comm_proto_send_sub_resi").addEventListener("click", function(){
var iframeElement = document.getElementById("ifrm");
iframeElement.src = "./html/寄存器.html";
});
document.getElementById("comm_proto_send_sub_RW").addEventListener("click", function(){
var iframeElement = document.getElementById("ifrm");
iframeElement.src = "./html/寄存器读写示例.html";
});
document.getElementById("comm_proto_send_sub_warring").addEventListener("click", function(){
var iframeElement = document.getElementById("ifrm");
iframeElement.src = "./html/常见问题和注意事项.html";
});
</script>
</body>
</html>
基本框架
<!DOCTYPE HTML>
<html>
<header>
<title>帮助文档</title>
</header>
<body>
<style>
body {
margin:0px;
padding:0px;
}
.leftNav {
position: fixed;
height: 100%;
width: 200px;
background: #D3D3D3;
left: 0px;
overflow-y: scroll;
}
.content {
padding-left:200px;
padding-bottom:0px;
}
.sync_height {
min-height:300px;
}
.default_li_hide {
display:none;
}
li:hover{
background:#778899;
cursor:pointer;
}
</style>
<div class="leftNav">
<ul style = "list-style: none">
<li id ="debug_doc" ><a>调试说明</a></li>
<ul style = "list-style: none" class="default_li_hide li_hover" id = "debug_doc_send_sub">
<li id ="debug_doc_send_sub_hardware_link"><a>设备硬件连接</a></li>
<li id ="debug_doc_send_sub_ui_link"><a>界面连接</a></li>
<li id ="debug_doc_send_sub_REH_ui"><a>REH界面图示</a></li>
<li id ="debug_doc_send_sub_REQ_ui"><a>REQ界面图示</a></li>
<li id ="debug_doc_send_sub_REV_ui"><a>REV界面图示</a></li>
<li id ="debug_doc_send_sub_bt_link"><a>蓝牙连接</a></li>
<li id ="debug_doc_send_sub_bt_display_link"><a>测量显示</a></li>
<li id ="debug_doc_send_sub_warring"><a>注意事项</a></li>
</ul>
<li id ="comm_proto"><a>通讯协议</a>
</li>
<ul style = "list-style: none" class="default_li_hide" id = "comm_proto_send_sub">
<li id ="comm_proto_send_sub_radar_proto"><a>雷达产品通信协议</a></li>
<li id ="comm_proto_send_sub_abstracts"><a>概述</a></li>
<li id ="comm_proto_send_sub_resi"><a>寄存器</a></li>
<li id ="comm_proto_send_sub_RW"><a>寄存器读写示例</a></li>
<li id ="comm_proto_send_sub_warring"><a>常见问题和注意事项</a></li>
</ul>
</ul>
</div>
<div class="content sync_height" id="myDiv">
//嵌套网页
<iframe id="ifrm" class="sync_height" width="100%" frameborder="0" src="./html/设备硬件连接.html" marginwidth="0" marginheight="0" vspace="0" hspace="0" allowtransparency="true" scrolling="true" allowfullscreen="true">
</iframe>
</div>
</div>
<script>
// 获取屏幕大小并设置div样式
window.addEventListener('DOMContentLoaded', function() {
var screenWidth = window.innerWidth;
var screenHeight = window.innerHeight;
var divElement = document.getElementById("myDiv");
var iframeElement = document.getElementById("ifrm");
divElement.style.width = screenWidth-220 + "px";
divElement.style.height = screenHeight-10 + "px";
iframeElement.style.width = screenWidth-220 + "px";
iframeElement.style.height = screenHeight -10+ "px";
});
//显示书签 二级列表的显示与隐藏
document.getElementById("debug_doc").addEventListener("click", function(){
var liElement = document.getElementById("debug_doc_send_sub");
if(liElement.style.display == "none")
liElement.style.display = "block";
else
liElement.style.display = "none";
});
//跳转页面 调试说明
document.getElementById("debug_doc_send_sub_hardware_link").addEventListener("click", function(){
var iframeElement = document.getElementById("ifrm");
iframeElement.src = "./html/设备硬件连接.html"; // 跳转的网页需要自己编写
});
</script>
</body>
</html>
效果如下图