first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
(function() {
var tabTitle = (document.getElementsByClassName("tab-title")[0]).getElementsByTagName("li");
var tabContent = (document.getElementsByClassName("tab-content")[0]).getElementsByTagName("li");
/**
* index.js 和 swiper.js 中变量 i 冲突
* 1: 更换index.js中变量i的名称,例如:ff
* 2: (function(){ })() 自执行函数+闭包 防止变量污染
*/
// 第一次for循环主要作用是为了给标题绑定 onmousemove 事件
for(let i = 0;i<tabTitle.length;i++) {
tabTitle[i].onmousemove = function () {
// 第二次for是为了清除标题和内容的激活样式
for(let j = 0;j<tabTitle.length;j++) {
tabTitle[j].className = ""
tabContent[j].className = "tab-content-item"
}
// 为当前悬浮的对象设置 激活样式
tabTitle[i].className = "selected"
tabContent[i].className = "tab-content-item item-active"
}
}
})()