当前位置:网站首页>Shandong University project training (VII) add navigation bar to select city
Shandong University project training (VII) add navigation bar to select city
2022-06-29 18:33:00 【MeditationRain】
List of articles
Our project is mainly divided into two parts , One is to check the air quality of city stations , By marking points ; The other is to check the pollution level of the city , By rendering the background color block color . The whole project includes... In Shandong Province 16 Cities —— jinan 、 Qingdao 、 zibo 、 Zaozhuang 、 dongying 、 yantai 、 weifang 、 Jining 、 Taian 、 weihai 、 sunshine 、 Linyi 、 Texas 、 Liaocheng 、 Binzhou 、 Heze , So I designed a two-level navigation bar , First, choose whether to check the air quality of the city site or the pollution level of the city , Then the next level is to choose the city .
One 、layUI Introduce :
layui( homophonic : class UI) It's an open source set Web UI Solution , Using its own classic modular specification , And follow the original HTML/CSS/JS Development mode , Easy to use , Use immediately . Its style is simple and light , And the components are elegant and rich , Every detail from the source code to the method of use has been carefully carved , Very suitable for the rapid development of web interface .layui Different from those based on MVVM The underlying front-end framework , But it's not against the road , It's about returning to nature . To be exact , It's more for back-end developers , You don't have to get involved in front-end tools , Just face the browser itself , Let all the elements and interactions you need , Come from here .
Two 、layUI introduce
layui get :https://github.com/layui/layui
layUI Introduce more critical code :
<link rel="stylesheet" href="./layui/css/layui.css">
<script src="./layui/layui.js"></script>
Quick start :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title> Start using layui</title>
<link rel="stylesheet" href="./layui/css/layui.css">
<!-- introduce css file -->
</head>
<body>
<!-- Yours HTML Code -->
<script src="./layui/layui.js"></script>
<!-- introduce js file -->
<script> layui.use(['layer', 'form'], function(){
var layer = layui.layer ,form = layui.form; layer.msg('Hello World'); }); </script>
<!-- Set flyout layer -->
</body>
</html>
3、 ... and 、layUI Use
I am going to use layUI The navigation bar :

Related codes :
<ul class="layui-nav">
<li class="layui-nav-item layui-this"><a href=""> Choose </a></li>
<li class="layui-nav-item">
<a href="javascript:;"> routine </a>
</li>
<li class="layui-nav-item"><a href=""> Navigation </a></li>
<li class="layui-nav-item">
<a href="javascript:;"> Sub level </a>
<dl class="layui-nav-child">
<dd><a href=""> menu 1</a></dd>
<dd><a href=""> menu 2</a></dd>
<dd><a href=""> menu 3</a></dd>
</dl>
</li>
<li class="layui-nav-item">
<a href="javascript:;"> Options </a>
<dl class="layui-nav-child">
<dd><a href=""> Options 1</a></dd>
<dd class="layui-this"><a href=""> Options 2</a></dd>
<dd><a href=""> Options 3</a></dd>
</dl>
</li>
<li class="layui-nav-item"><a href=""> demonstration </a></li>
</ul>
<script> layui.use('element', function(){
var element = layui.element; // Navigational hover effect 、 Second level menu and other functions , Need to rely on element modular // Monitor navigation Click element.on('nav(demo)', function(elem){
//console.log(elem) layer.msg(elem.text()); }); }); </script>
Four 、 Project use
Effect display :



Add code :
First introduced layUI Related documents of .
<link rel="stylesheet" href="./layui/css/layui.css"><script src="./layui/layui.js"></script>Then add... To the navigation bar html Content , And make appropriate changes to the style .
<ul class="layui-nav"> <li class="layui-nav-item layui-this"> <a href="javascript:;"> Check the air quality of city stations </a> <dl class="layui-nav-child" style="width: 300px;"> <dd> <a onclick="change_center(' Jinan City ')" style="display: inline-block;"> jinan </a> <a onclick="change_center(' Qingdao ')" style="display: inline-block;"> Qingdao </a> <a onclick="change_center(' Zibo City ')" style="display: inline-block;"> zibo </a> <a onclick="change_center(' Zaozhuang City ')" style="display: inline-block;"> Zaozhuang </a> </dd> <dd> <a onclick="change_center(' Dongying City ')" style="display: inline-block;"> dongying </a> <a onclick="change_center(' Yantai City ')" style="display: inline-block;"> yantai </a> <a onclick="change_center(' Weifang City ')" style="display: inline-block;"> weifang </a> <a onclick="change_center(' Jining City ')" style="display: inline-block;"> Jining </a> </dd> <dd> <a onclick="change_center(' Tai'an City ')" style="display: inline-block;"> Taian </a> <a onclick="change_center(' Rizhao City ')" style="display: inline-block;"> sunshine </a> <a onclick="change_center(' Weihai City ')" style="display: inline-block;"> weihai </a> <a onclick="change_center(' Binzhou City ')" style="display: inline-block;"> Binzhou </a> </dd> <dd> <a onclick="change_center(' Texas City ')" style="display: inline-block;"> Texas </a> <a onclick="change_center(' Liaocheng City ')" style="display: inline-block;"> Liaocheng </a> <a onclick="change_center(' Linyi City ')" style="display: inline-block;"> Linyi </a> <a onclick="change_center(' Heze City ')" style="display: inline-block;"> Heze </a> </dd> </dl> </li> <li class="layui-nav-item"> <a href="javascript:;"> Check the pollution level of the city </a> <dl class="layui-nav-child" style="width: 300px;"> <dd> <a onclick="change_center(' Jinan City ')" style="display: inline-block;"> jinan </a> <a onclick="change_center(' Qingdao ')" style="display: inline-block;"> Qingdao </a> <a onclick="change_center(' Zibo City ')" style="display: inline-block;"> zibo </a> <a onclick="change_center(' Zaozhuang City ')" style="display: inline-block;"> Zaozhuang </a> </dd> <dd> <a onclick="change_center(' Dongying City ')" style="display: inline-block;"> dongying </a> <a onclick="change_center(' Yantai City ')" style="display: inline-block;"> yantai </a> <a onclick="change_center(' Weifang City ')" style="display: inline-block;"> weifang </a> <a onclick="change_center(' Jining City ')" style="display: inline-block;"> Jining </a> </dd> <dd> <a onclick="change_center(' Tai'an City ')" style="display: inline-block;"> Taian </a> <a onclick="change_center(' Rizhao City ')" style="display: inline-block;"> sunshine </a> <a onclick="change_center(' Weihai City ')" style="display: inline-block;"> weihai </a> <a onclick="change_center(' Binzhou City ')" style="display: inline-block;"> Binzhou </a> </dd> <dd> <a onclick="change_center(' Texas City ')" style="display: inline-block;"> Texas </a> <a onclick="change_center(' Liaocheng City ')" style="display: inline-block;"> Liaocheng </a> <a onclick="change_center(' Linyi City ')" style="display: inline-block;"> Linyi </a> <a onclick="change_center(' Heze City ')" style="display: inline-block;"> Heze </a> </dd> </dl> </li> </ul>Finally, click the transformation of the center point of the city map js Code .
function change_center(place) { //alert(place); map.centerAndZoom(place, 12); }
边栏推荐
- MySQL -connector/j driver download
- JDBC knowledge
- Adobe Premiere foundation - opacity (matte) (11)
- Data-* attribute usage
- 优雅书写Controller(参数验证+统一异常处理)
- [tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area
- 【TcaplusDB知识库】TcaplusDB系统用户组介绍
- Interview question 10.10 Rank of digital stream
- 报错Failed to allocate graph: MYRIAD device is not opened.
- Adobe Premiere基礎-聲音調整(音量矯正,降噪,電話音,音高換擋器,參數均衡器)(十八)
猜你喜欢

JWT登录验证

Automatic software test - read SMS verification code using SMS transponder and selenium

剑指 Offer 34. 二叉树中和为某一值的路径-dfs法

Adobe Premiere foundation - opacity (matte) (11)
![报错[warning] Neural network inference was performed on socket ‘RGB’, depth frame is aligned to socket](/img/8a/ebad75daa581e22d50dddde49e1fac.jpg)
报错[warning] Neural network inference was performed on socket ‘RGB’, depth frame is aligned to socket

Niuke small Bai monthly race 52 D ring insectivorous (feet +st table)

Adobe Premiere基础-编辑素材文件常规操作(脱机文件,替换素材,素材标签和编组,素材启用,便捷调节不透明度,项目打包)(十七)

源码安装MAVROS

Proxmox VE Install 7.2

Adobe Premiere foundation - material nesting (animation of Tiktok ending avatar) (IX)
随机推荐
《安富莱嵌入式周报》第271期:2022.06.20--2022.06.26
Travel card "star picking" hot search first! Stimulate the search volume of tourism products to rise
Adobe Premiere Basics - common video effects (cropping, black and white, clip speed, mirroring, lens halo) (XV)
JS merge two one-dimensional arrays and remove the same items (collation)
/usr/bin/ld: warning: **libmysqlclient. so. 20**, needed by //usr/
Application and practice of DDD in domestic hotel transaction -- Theory
3H proficient in opencv (VII) - color detection
C comparison of the performance of dapper efcore sqlsugar FreeSQL hisql sqlserver, an ORM framework at home and abroad
Request header field xxxx is not allowed by Access-Control-Allow-Headers in preflight response问题
Adobe Premiere foundation - batch material import sequence - variable speed and rewind (recall) - continuous action shot switching - subtitle requirements (13)
Adobe Premiere foundation - opacity (matte) (11)
Servlet student management system (Mengxin hands-on version)
[tcapulusdb knowledge base] tcapulusdb doc acceptance - table creation approval introduction
Jar package background startup and log output
山东大学项目实训(六)点击事件展示折线图
Codeworks 5 questions per day (1700 for each) - the next day
3H proficient in opencv (VIII) - shape detection
山东大学项目实训(八)设计轮播图进入页面
Adobe Premiere foundation - opacity (mixed mode) (XII)
My first experience of remote office | community essay solicitation