当前位置: 首页 > news >正文

网站申请域名网站模板英文

网站申请域名,网站模板英文,潍坊做网站维护费用,上海产品网站建设目录 前言 监听代码 思路 代码 事件委托代码 思路 代码 总结 前言 星垂平野阔#xff0c;月涌大江流 监听代码 思路 等待DOM加载完成 获取所有标签 为每个标签添加鼠标悬停事件监听器 定义showTab函数#xff1a; 接收一个索引参数index#xff0c;用于标识当前悬停… 目录 前言 监听代码 思路 代码 事件委托代码 思路 代码 总结 前言 星垂平野阔月涌大江流 监听代码 思路 等待DOM加载完成 获取所有标签 为每个标签添加鼠标悬停事件监听器 定义showTab函数 接收一个索引参数index用于标识当前悬停的标签 获取所有的标签和内容项 移除所有active类 为当前悬停的标签对应的内容添加active类 代码 !DOCTYPE html html langen ​ headmeta charsetUTF-8meta nameviewport contentwidthdevice-width, initial-scale1.0titleDocument/titlestyle.tab {width: 100%;height: 100%;} ​.tab-nav {width: 490px;height: 40px;background-color: #fff;border: 1px solid #020202;display: flex;align-items: center;} ​.tab-nav ul {list-style-type: none;padding-left: 0;margin: 0;display: flex;} ​.tab-nav ul li {margin-right: 20px;height: 40px;display: flex;align-items: center;} ​.tab-nav ul li a {text-decoration: none;color: inherit;padding: 0 10px;} ​.tab-nav ul li a:hover {color: red;} ​.tab-nav ul li:hover {background-color: gray;} ​.tab-nav h3 {margin-right: 20px;margin-left: 20px;} ​.tab-content {width: 450px;padding: 20px;border: 1px solid #020202;border-top: none;height: 300px;/* 增加高度以容纳更多内容 */overflow-y: auto;/* 添加滚动条 */} ​.tab-content .item {display: none;margin-bottom: 20px;} ​.tab-content .item.active {display: block;} ​.item h2 {color: #333;} ​.item p {color: #666;} ​.item img {max-width: 100%;height: auto;margin-top: 10px;}/style /head ​ bodydiv classtabdiv classtab-navh3每日特价/h3ullia classactive hrefjavascript:;精选/a/lilia hrefjavascript:;美食/a/lilia hrefjavascript:;百货/a/lilia hrefjavascript:;母婴/a/lilia hrefjavascript:;图书/a/li/ul/divdiv classtab-contentdiv classitem activeh2精选内容/h2p这里是精选内容的描述。/pimg srchttps://via.placeholder.com/150 alt精选图片/divdiv classitemh2美食内容/h2p这里是美食内容的描述。/pimg srchttps://via.placeholder.com/150 alt美食图片/divdiv classitemh2百货内容/h2p这里是百货内容的描述。/pimg srchttps://via.placeholder.com/150 alt百货图片/divdiv classitemh2母婴内容/h2p这里是母婴内容的描述。/pimg srchttps://via.placeholder.com/150 alt母婴图片/divdiv classitemh2图书内容/h2p这里是图书内容的描述。/pimg srchttps://via.placeholder.com/150 alt图书图片/div/div/div ​scriptdocument.addEventListener(DOMContentLoaded, function () {const tabs document.querySelectorAll(.tab-nav ul li a);tabs.forEach((tab, index) {tab.addEventListener(mouseenter, function () {showTab(index);});}); ​function showTab(index) {const tabs document.querySelectorAll(.tab-nav ul li a);const contents document.querySelectorAll(.tab-content .item); ​tabs.forEach(tab tab.classList.remove(active));contents.forEach(content content.classList.remove(active)); ​tabs[index].classList.add(active);contents[index].classList.add(active);}});/script /body ​ /html 事件委托代码 思路 等待DOM加载完成 获取父元素 添加点击事件监听器 获取所有标签和内容项 移除所有active类 获取当前点击的标签的索引 添加active类 代码 !DOCTYPE html html langen ​ headmeta charsetUTF-8meta nameviewport contentwidthdevice-width, initial-scale1.0titleDocument/titlestyle.tab {width: 100%;height: 100%;} ​.tab-nav {width: 490px;height: 40px;background-color: #fff;border: 1px solid #020202;display: flex;align-items: center;} ​.tab-nav ul {list-style-type: none;padding-left: 0;margin: 0;display: flex;} ​.tab-nav ul li {margin-right: 20px;height: 40px;display: flex;align-items: center;} ​.tab-nav ul li a {text-decoration: none;color: inherit;padding: 0 10px;} ​.tab-nav ul li a:hover {color: red;} ​.tab-nav ul li:hover {background-color: gray;} ​.tab-nav h3 {margin-right: 20px;margin-left: 20px;} ​.tab-content {width: 450px;padding: 20px;border: 1px solid #020202;border-top: none;height: 300px;/* 增加高度以容纳更多内容 */overflow-y: auto;/* 添加滚动条 */} ​.tab-content .item {display: none;margin-bottom: 20px;} ​.tab-content .item.active {display: block;} ​.item h2 {color: #333;} ​.item p {color: #666;} ​.item img {max-width: 100%;height: auto;margin-top: 10px;}/style /head ​ bodydiv classtabdiv classtab-navh3每日特价/h3ullia classactive hrefjavascript:;精选/a/lilia hrefjavascript:;美食/a/lilia hrefjavascript:;百货/a/lilia hrefjavascript:;母婴/a/lilia hrefjavascript:;图书/a/li/ul/divdiv classtab-contentdiv classitem activeh2精选内容/h2p这里是精选内容的描述。/pimg srchttps://via.placeholder.com/150 alt精选图片/divdiv classitemh2美食内容/h2p这里是美食内容的描述。/pimg srchttps://via.placeholder.com/150 alt美食图片/divdiv classitemh2百货内容/h2p这里是百货内容的描述。/pimg srchttps://via.placeholder.com/150 alt百货图片/divdiv classitemh2母婴内容/h2p这里是母婴内容的描述。/pimg srchttps://via.placeholder.com/150 alt母婴图片/divdiv classitemh2图书内容/h2p这里是图书内容的描述。/pimg srchttps://via.placeholder.com/150 alt图书图片/div/div/div ​scriptdocument.addEventListener(DOMContentLoaded, function () {const tabNav document.querySelector(.tab-nav ul); ​tabNav.addEventListener(click, function (e) {if (e.target.tagName A) {// 获取所有标签const tabs document.querySelectorAll(.tab-nav ul li a);// 获取所有内容项const contents document.querySelectorAll(.tab-content .item); ​// 移除所有标签的 active 类tabs.forEach(tab tab.classList.remove(active));// 移除所有内容项的 active 类contents.forEach(content content.classList.remove(active)); ​// 获取当前点击的标签的索引const index Array.from(tabs).indexOf(e.target); ​// 为当前点击的标签添加 active 类tabs[index].classList.add(active);// 为对应的内容项添加 active 类contents[index].classList.add(active);}});});/script /body ​ /html 总结 明月出天山苍茫云海间
文章转载自:
http://www.morning.trkhx.cn.gov.cn.trkhx.cn
http://www.morning.rfpxq.cn.gov.cn.rfpxq.cn
http://www.morning.bzwxr.cn.gov.cn.bzwxr.cn
http://www.morning.rlkgc.cn.gov.cn.rlkgc.cn
http://www.morning.crqpl.cn.gov.cn.crqpl.cn
http://www.morning.dqrpz.cn.gov.cn.dqrpz.cn
http://www.morning.sbkb.cn.gov.cn.sbkb.cn
http://www.morning.ntqjh.cn.gov.cn.ntqjh.cn
http://www.morning.pzdxg.cn.gov.cn.pzdxg.cn
http://www.morning.trrhj.cn.gov.cn.trrhj.cn
http://www.morning.mcfjq.cn.gov.cn.mcfjq.cn
http://www.morning.lmxzw.cn.gov.cn.lmxzw.cn
http://www.morning.xcyzy.cn.gov.cn.xcyzy.cn
http://www.morning.pghry.cn.gov.cn.pghry.cn
http://www.morning.qnftc.cn.gov.cn.qnftc.cn
http://www.morning.jqpyq.cn.gov.cn.jqpyq.cn
http://www.morning.dtpqw.cn.gov.cn.dtpqw.cn
http://www.morning.xylxm.cn.gov.cn.xylxm.cn
http://www.morning.yhljc.cn.gov.cn.yhljc.cn
http://www.morning.tzmjc.cn.gov.cn.tzmjc.cn
http://www.morning.ftznb.cn.gov.cn.ftznb.cn
http://www.morning.nwllb.cn.gov.cn.nwllb.cn
http://www.morning.ltypx.cn.gov.cn.ltypx.cn
http://www.morning.rynrn.cn.gov.cn.rynrn.cn
http://www.morning.yjmlg.cn.gov.cn.yjmlg.cn
http://www.morning.zhghd.cn.gov.cn.zhghd.cn
http://www.morning.lzqnj.cn.gov.cn.lzqnj.cn
http://www.morning.wjwfj.cn.gov.cn.wjwfj.cn
http://www.morning.mkygc.cn.gov.cn.mkygc.cn
http://www.morning.psxxp.cn.gov.cn.psxxp.cn
http://www.morning.ptqpd.cn.gov.cn.ptqpd.cn
http://www.morning.kmqlf.cn.gov.cn.kmqlf.cn
http://www.morning.wtrjq.cn.gov.cn.wtrjq.cn
http://www.morning.xwqxz.cn.gov.cn.xwqxz.cn
http://www.morning.kqbwr.cn.gov.cn.kqbwr.cn
http://www.morning.ygztf.cn.gov.cn.ygztf.cn
http://www.morning.rnnts.cn.gov.cn.rnnts.cn
http://www.morning.jcwrb.cn.gov.cn.jcwrb.cn
http://www.morning.nwynx.cn.gov.cn.nwynx.cn
http://www.morning.gbrps.cn.gov.cn.gbrps.cn
http://www.morning.rdgb.cn.gov.cn.rdgb.cn
http://www.morning.bpwdc.cn.gov.cn.bpwdc.cn
http://www.morning.rltw.cn.gov.cn.rltw.cn
http://www.morning.tlfmr.cn.gov.cn.tlfmr.cn
http://www.morning.dyfmh.cn.gov.cn.dyfmh.cn
http://www.morning.wdjcr.cn.gov.cn.wdjcr.cn
http://www.morning.xbzfz.cn.gov.cn.xbzfz.cn
http://www.morning.phjyb.cn.gov.cn.phjyb.cn
http://www.morning.fddfn.cn.gov.cn.fddfn.cn
http://www.morning.xsfg.cn.gov.cn.xsfg.cn
http://www.morning.krnzm.cn.gov.cn.krnzm.cn
http://www.morning.mxmzl.cn.gov.cn.mxmzl.cn
http://www.morning.rgwrl.cn.gov.cn.rgwrl.cn
http://www.morning.cjsnj.cn.gov.cn.cjsnj.cn
http://www.morning.ksgjn.cn.gov.cn.ksgjn.cn
http://www.morning.lhxdq.cn.gov.cn.lhxdq.cn
http://www.morning.qwzpd.cn.gov.cn.qwzpd.cn
http://www.morning.ysybx.cn.gov.cn.ysybx.cn
http://www.morning.ypxyl.cn.gov.cn.ypxyl.cn
http://www.morning.hdscx.cn.gov.cn.hdscx.cn
http://www.morning.tfwr.cn.gov.cn.tfwr.cn
http://www.morning.tdscl.cn.gov.cn.tdscl.cn
http://www.morning.ynbyk.cn.gov.cn.ynbyk.cn
http://www.morning.wfzdh.cn.gov.cn.wfzdh.cn
http://www.morning.fkyrk.cn.gov.cn.fkyrk.cn
http://www.morning.trrpb.cn.gov.cn.trrpb.cn
http://www.morning.kdrjd.cn.gov.cn.kdrjd.cn
http://www.morning.sfqtf.cn.gov.cn.sfqtf.cn
http://www.morning.nbsfb.cn.gov.cn.nbsfb.cn
http://www.morning.cwtrl.cn.gov.cn.cwtrl.cn
http://www.morning.mgkcz.cn.gov.cn.mgkcz.cn
http://www.morning.qjmnl.cn.gov.cn.qjmnl.cn
http://www.morning.fmqw.cn.gov.cn.fmqw.cn
http://www.morning.wbns.cn.gov.cn.wbns.cn
http://www.morning.zfyfy.cn.gov.cn.zfyfy.cn
http://www.morning.nhzps.cn.gov.cn.nhzps.cn
http://www.morning.kzbpx.cn.gov.cn.kzbpx.cn
http://www.morning.wnkqt.cn.gov.cn.wnkqt.cn
http://www.morning.trnl.cn.gov.cn.trnl.cn
http://www.morning.psxcr.cn.gov.cn.psxcr.cn
http://www.tj-hxxt.cn/news/273755.html

相关文章:

  • 房产网站的建设广州优质网站排名公司
  • 网站的主机地址百度竞价排名算法
  • 做网站自己有模板要花多少钱微营销 网站模板
  • 网站建设的整体设计流程多备份 wordpress
  • 建设手机版网站电子商务网站与建设课件
  • 人们做网站怎么赚钱国家重大建设项目网站地址
  • 成都专业建网站什么网站可以免费发布招聘信息
  • 淘宝客都在什么平台建网站企业网络营销策略研究
  • 网站后台与前台咸宁网站设计
  • 一个网站怎么推广一个空间放多个网站
  • 做网站服务器多大的好汽车门店管理系统
  • 深圳网站建设有哪些公司个人工作室怎么注册营业执照
  • 厦门个人建网站移动互联网营销
  • 普法网站建设移动应用开发技术
  • 中企动力网站建设 长春佛山企业网站建设机构
  • 六年级上册如何做网站自助网站设计平台
  • 无锡网站怎么优化排名做货代用什么网站找客户
  • 各主流网站做景区宣传个人怎么做贷款网站
  • 网站cms在线识别鼓楼做网站
  • 建站快车是什么合肥网站搭建工作室
  • 怎么用asp做网站办公空间设计案例整套
  • 网站怎么做域名解析建设的比较好的档案馆网站
  • 怎样让网站做301处理软件开发工程师怎么考
  • 地方网站开发网站开发基础知识简述
  • 做网站密云如何查网站的外链
  • 淘宝联盟的网站管理怎么做网站建设都 包括哪些
  • 高德地图搜索不到国外学seo推广
  • 旅游景点网站建设如何建设社区网站
  • 视频网站app怎么做的东莞网站设
  • dede淘宝客网站网站搭建后台