sweiper做一个tab切换
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="ie=edge"> <title>Document</title> <link rel="stylesheet" href="https://unpkg.com/swiper/css/swiper.min.css"> <script src="https://unpkg.com/swiper/js/swiper.min.js"> </script> <style> html, body { } body { font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 14px; margin: 0; padding: 0; } .swiper-container { width: 100%; margin-left: auto; margin-right: auto; } .gallery-top { height:auto; width: 100%; } .gallery-top .sweiper_content{ background:#000000; text-align: center; color:#ffffff; height:300px; } .gallery-thumbs { height:100px; box-sizing: border-box; padding: 10px 0; } .gallery-thumbs .swiper-slide { width: 50%; height: 100%; } .gallery-thumbs .swiper_tab{ color:#000000; text-align: center; height:100px; line-height:100px; } .gallery-thumbs .swiper-slide-thumb-active { color:#ffffff; border-top-left-radius:20px; border-top-right-radius: 20px; background:#000000; } </style> </head> <body> <!-- 导航 --> <div class="swiper-container gallery-thumbs"> <div class="swiper-wrapper"> <div class="swiper-slide swiper_tab">注册</div> <div class="swiper-slide swiper_tab">已注册</div> </div> </div> <!-- Swiper --> <div class="swiper-container gallery-top"> <div class="swiper-wrapper"> <div class="swiper-slide sweiper_content">1111111111111111111</div> <div class="swiper-slide sweiper_content">222222222222222222</div> </div> <!-- Add Arrows --> <!-- <div class="swiper-button-next swiper-button-white"></div> <div class="swiper-button-prev swiper-button-white"></div> --> </div> <!-- Initialize Swiper --> <script> //导航 var galleryThumbs = new Swiper('.gallery-thumbs', { spaceBetween: 10, slidesPerView: 2, freeMode: true, watchSlidesVisibility: true, watchSlidesProgress: true, }); // 内容 var galleryTop = new Swiper('.gallery-top', { spaceBetween: 10, // navigation: { // nextEl: '.swiper-button-next', // prevEl: '.swiper-button-prev', // }, thumbs: { swiper: galleryThumbs } }); </script> </body> </html>
。。。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· Manus爆火,是硬核还是营销?
· 终于写完轮子一部分:tcp代理 了,记录一下
· 别再用vector<bool>了!Google高级工程师:这可能是STL最大的设计失误
· 单元测试从入门到精通
2018-10-25 js实现点击div以外区域,隐藏div区域