Knowledge Points: html/css, label application, style explanation, static development layout, industry standard. JS base, if judgment, JQ method Dom operation, logical thinking.
HTML code:
<div class="top"> <div class="t-header"> <div class="t-logo"> <a href="#"> </a> </div> <div class="t-desc">LBS移动点餐系统</div> </div> </div> <!--end top--> <!--content start--> <div class="content"> <div class="c-title">点外卖,上饿了么 !</div> <div class="c-con" id="c-map"></div> <!--search start--> <div class="search"> <input type="text" class="s-text" placeholder="请输入地址 ..." id="s-search"/><input type="button" class="s-btn" value="搜 索" /> </div> <!--end search--> </div>
CSS code:
<style type= "Text/css" > *{margin:0;padding:0;} Body{background:url ("Images/bg.png"); font-size:12px;font-family: "Microsoft Jas Black"; color: #666;} /*top start*/. top{width:100%;height:40px;margin:30px 0;} . Top. t-header{width:1000px;height:40px;margin:0 Auto;} . Top. T-header. t-logo{float:left;margin-top:10px;} . Top. T-header. T-desc{float:right;line-height:40px;font-size:16px;color: #fff;} /*end top*//*content start*/. content{width:1000px;height:600px;margin:0 auto;position:relative;} . Content. C-title{height:60px;background: #f90; text-align:center;line-height:60px;font-size:22px;font-weight:300 ; color: #fff;} . content. c-con{width:1000px;height:540px;} /*end content*//*search start*/. Search{width:610px;height:56px;background: #6cf; box-shadow:1px 2px 10px-2px #000;p osition:absolute;top:100px;left:200px;} . Search . s-text{width:490px;height:56px;border:none;outline:none;padding-left:10px;} . Search. S-btn{width:110px;height:56px;background: #f30; Border:none;color: #fff; cursor:pointer;outline:none;} . Search. S-btn:hover{background: #cc2800;} /*end search*/</style>
JavaScript code:
<script src="http://webapi.amap.com/maps?v=1.3&key=a82669655cc541a1793e86f273fac31e&plugin=AMap.Autocomplete,AMap.PlaceSearch"></script><script type="text/javascript"> //地图加载 var map = new AMap.Map("c-map", { resizeEnable: true }); //输入提示 var autoOptions = { input: "s-search" }; var auto = new AMap.Autocomplete(autoOptions); var placeSearch = new AMap.PlaceSearch({ map: map }); //构造地点查询类 AMap.event.addListener(auto, "select", select);//注册监听,当选中某条记录时会触发 function select(e) { placeSearch.setCity(e.poi.adcode); placeSearch.search(e.poi.name); //关键字查询查询 }</script>
Interested in learning to learn the Web front end can come to the Web front end Qun "189394454" can get 2018 of the latest web front-end learning materials for free.
Follow the public number → ' Learn the web front end ' to open your Web front end learning Path
Web Front end Practical case-develop hungry? lbs Mobile Map ordering System