效果:
方法: 1、其他头部信息:添加代码去掉帮助分类,已经去除的可忽略。 - <!--隐藏帮助分类-->
- <style>
- #faq .main,#faq .content {margin-left:0px!important;}
- #faq .side {display:none;}
- </style>
- <!--隐藏帮助分类end-->
複製代碼
2、新建帮助分类将下面代码放进去 -
- <script>$("wrap").className="wrap s_clear";$("nav").innerHTML='<a href="index.php">TLB爱我吧俱乐部</a> »百度地图';</script>
- <script type="text/javascript" src="http://api.map.baidu.com/api?v=1.4"></script>
- <style type="text/css">
- #ct { position: relative; }
- #srch { position: absolute; top: 10px; left: 100px; z-index: 100; border: 1px solid #cdcdcd; background: #f3f3f3; padding: 3px; }
- </style>
- <div id="ct" class="wp cl">
- <div id="srch">
- <input type="text" class="px vm" id="keyword" /><button type="button" class="pn pnp vm" onclick="search()"><strong>搜索</strong></button>
- </div>
- <div id="baidu_map" class="bm" style="width:100%; height:600px;"></div>
- </div>
- <script type="text/javascript">
- var map = new BMap.Map("baidu_map");
- map.addControl(new BMap.NavigationControl());
- map.addControl(new BMap.ScaleControl());
- map.addControl(new BMap.OverviewMapControl());
- map.addControl(new BMap.MapTypeControl());
- map.centerAndZoom(new BMap.Point(), 17);
- var myCity = new BMap.LocalCity();
- myCity.get(function(result) {
- map.centerAndZoom(result.name, 17);
- });
- var local = new BMap.LocalSearch(map, {
- renderOptions: {
- map: map,
- autoViewport: true,
- selectFirstResult: false
- }
- });
- function search() {
- local.clearResults();
- local.search($('keyword').value);
- }
- </script>
複製代碼
3、新建一个导航链接即可。 |