当前位置:网站首页>Realizing tab switching with foreach and ES6
Realizing tab switching with foreach and ES6
2022-04-22 22:44:00 【Dai Sensen】
effect :

html Code :
<ul class="nav">
<!-- <li> <a href=""> front end </a> <ul class="select"> <li> Employment class </li> <li> The high-quality goods </li> <li> College welfare </li> </ul> </li> <li> <a href="">Python</a> </li> <li> <a href="">JavaEE</a> </li> -->
</ul>
css Code :
* {
margin: 0;
padding: 0;
}
a {
color: black;
text-decoration: none;
}
li {
width: 70px;
list-style: none;
}
.nav {
text-decoration: none;
list-style: none;
}
.nav>li {
background-color: lightsteelblue;
padding: 10px 15px;
text-align: center;
float: left;
}
js Code :
<script src="../ Stage four jquery/jquery Programming /jquery.min.js"></script>
<script>
var arr1 = [' front end ', 'Python', 'JavaEE'];
var arr2 = [' Employment class ', ' The high-quality goods ', ' College welfare '];
var nava = ``;
var naul = ``;
arr1.forEach(function(item) {
console.log(item);
nava += `<li><a href="">${
item}</a><ul class="select"></ul></li> `;
$(".nav").html(nava);
});
arr2.forEach(function(item) {
console.log(item);
naul += `<li>${
item}</li>`;
$(".select").html(naul);
});
$(".nav>li").children("ul").hide();
$(".nav>li").mouseleave(function() {
$(this).children("ul").hide();
});
$(".nav>li").mouseover(function() {
$(this).children("ul").show();
});
</script>
版权声明
本文为[Dai Sensen]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204222203201056.html
边栏推荐
- GBase 8s V8.8 SQL 指南:教程-6.2.1(2)
- A journey to C by Xiao Sai Mao -- first understanding of C language (3)
- 知识图谱开篇笔记
- 接续符介绍及用法和++和--操作符分析介绍及用法
- [intranet penetration] - vulnstack (I)
- How to judge how many levels of insurance the enterprise should do? What is the significance of waiting insurance?
- 跨域问题及Umi-proxy代理解决跨域问题
- Characteristics of Vickers Vickers proportional valve
- Infix to suffix expression (inverse Polish) to prefix expression (polish)
- O0 O1 O2 O3优化原理
猜你喜欢

Listing on the Shanghai Stock Exchange of CNOOC: market value of 6.515 billion and annual profit of 70.3 billion

初学单片机点亮第一个外设--LED灯

外部中断---------stm32f407zet6

GBase 8s V8. 8 SQL Guide: Tutorial - 6.2.1 (2)

Basic practice of C language (002-1)

MySql--- 数据类型

【4.1】flink窗口算子的trigger触发器和Evictor清理器

51 MCU proteus simulation key control nixie tube digital display

2.56-试着用不同的示例值来运行show_bytes的代码。

Lily medical IPO was terminated: Huang Weiguo, the father of Huang Kai, the actual controller, was once the vice mayor of Foshan
随机推荐
Which is the most suitable educational financial product?
Infix to suffix expression (inverse Polish) to prefix expression (polish)
加法逆元(a^a=0)异或操作,这个并没有性能上的优势,只是一个智力游戏
GBase 8s V8.8 SQL 指南:教程-6.2
意大利阿托斯电磁阀的工作性质是什么?
餐饮行业收银系统源码,C# .NET + MSSQL WPF
【洛穀】P1162 填塗顏色(bfs)
快速计算约数的个数——从基础到高级
Mathematics - Bezier curve
2.59-编写一个C表达式,它生成一个字,由x的最低有效字节和y中剩下的字节组成。对于运算数x =0x89ABCDEF和y=0x76543210,就得到0x765432EF.
2.57-编写程序show_short, show_long和show_double,它们分别打印类型为short, long和double的C语言对象的字节表示。请试着在几种机器上运行。
吴恩达-深度学习微课-第四课
Rasa课程、Rasa培训、Rasa面试、Rasa实战系列之Rasa全新全局词槽映射的 3 大方法
多线程进阶(八)----线程池
一个简单易用的文件上传方案
公众号配置伪静态防止出现页面路径加载问题
MySql内置函数
[Istio是什么?] 还不知道你就out了,一文40分钟快速理解
Take you to understand the principle of highly flexible spark architecture
多线程进阶(六)----锁机制