如何实现百度地图的左栏的收缩展开功能 百度地图左栏收缩 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <style> #leftBar { width: 100px; height: 500px; float: left; background-color: blue; } #rightPage { position: relative; margin-left: 100px; height: 500px; } .btn_toggleLeft { position: absolute; top: 0; bottom: 0; width: 20px; height: 80px; left: 0; margin: auto; background-color: white; cursor: pointer; } .content { background-color: lightskyblue; height: 100%; } </style> <div> <div id="leftBar" class="leftBar"> </div> <div id="rightPage" style=""> <div class="btn_toggleLeft" onclick="test()"> 你点我啊 </div> <div class="content"> </div> </div> </div> <script> function test() { var leftBar = document.getElementById("leftBar"); var content = document.getElementById("rightPage"); if (leftBar.style.display != "none") { leftBar.style.display = "none"; content.style.marginLeft = 0; } else { leftBar.style.display = "block"; content.style.marginLeft = "100px"; } } </script> 日期UTC格式转化 关于Extjs tree的问题 JS中怎么获取input所在页面的绝对坐标 AJAX,如何一次刷新同一页面两个地方的内容呢? 关于隐藏行高度的获得 怎样用javascript获取css在外面定义的高度? 大家帮我看看吧,为什么不能给编辑框赋值? 如何点击链接下载文件! 在windows98 中怎么安装PHP服务器,哪里有php服务器下载?? 一道阿里巴巴笔试题,求大神解答 jqmobi 与 jquery 不兼容 输入框延迟验证功能能实现吗
#leftBar
{
width: 100px;
height: 500px;
float: left;
background-color: blue;
} #rightPage
{
position: relative;
margin-left: 100px;
height: 500px;
} .btn_toggleLeft
{
position: absolute;
top: 0;
bottom: 0;
width: 20px;
height: 80px;
left: 0;
margin: auto;
background-color: white;
cursor: pointer;
} .content
{
background-color: lightskyblue;
height: 100%;
}
</style>
<div>
<div id="leftBar" class="leftBar">
</div>
<div id="rightPage" style="">
<div class="btn_toggleLeft" onclick="test()">
你点我啊
</div>
<div class="content">
</div>
</div>
</div>
<script>
function test() {
var leftBar = document.getElementById("leftBar");
var content = document.getElementById("rightPage");
if (leftBar.style.display != "none") {
leftBar.style.display = "none";
content.style.marginLeft = 0;
}
else {
leftBar.style.display = "block";
content.style.marginLeft = "100px";
}
}
</script>