Introduction to Swiper's tabs
We talked about Angular’s tabs yesterday, so let’s talk about Swiper’s tabs today!
Today’s tabs are Zepto combined with Swiper’s tabs. Let’s talk about pure Swiper tomorrow. Right!
Since it’s a tab about Zepto and Swiper, that’s it! There must be plug-ins for Swiper and Zepto,
are these two:
zepto.min.js
swiper.min.js
And swiper.min.css
These are the three,
are respectively for layout, events, and sliding effects! Okay! Without further ado, Cuihua, here’s the code:
<!DOCTYPE html> <html> <head> <meta charset="UTF-8"> //此乃移动端的标签 <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" /> <title>选项卡哦!</title> <link rel="stylesheet" href="js/swiper/swiper.min.css?1.1.11" /> <style type="text/css"> * margin: 0 padding: 0 font-family: "微软雅黑" margin: 0 width: 100% padding- text- width: 33% text- .tabs .part:first- border- /*这些是等待被操作的样式哦!*/ text- margin: 0 font- text- padding- border- .swiper- width: 100% border-top: 0 margin-top: 10px! .swiper- width: 100% color: #373737 text- </style> </head> <body class="bgc_gray"> <div class="pg-main"> <div id="wrapper"> <div class="wrap"> <div class="tabs"> //三个选项 <span class="part active"> <a href="#" hidefocus="true" >全免费</a> </span> <span class="part" style="border-right: 1px solid #ADDAFD"> <a href="#" hidefocus="true">优惠券</a> </span> <span class="part"> <a href="#" hidefocus="true">个人免费</a> </span> </div> <div class="swiper-container"> <div class="swiper-wrapper"> <div class="swiper-slide swiper-slide-visible swiper-slide-active"> <!--滑动区--> <div class="content-slide"> <p>这位朋友</p> <p>请在此稍作停留</p> <p>你今天身上有卦 别怕</p> <p>给我看看你的手</p> <p>胡说八道</p> <p>葫芦里卖的什么药</p> <p>不过是江湖圈套 可笑</p> <p>让警察把你赶跑</p> </div> </div> <div class="swiper-slide"> <div class="content-slide"> <p>恕我直言</p> <p>你夜晚无法安眠</p> <p>你遇到一个梦魇</p> <p>每天 什么藏在你床边</p> <p>话音刚落</p> <p>我已被冷汗浸透</p> <p>他说的一点不错 拜托</p> <p>请你一定救救我</p> </div> </div> <div class="swiper-slide"> <div class="content-slide"> <p>我銕口直断 为你消灾解难</p> <p>阴阳自在我心间 与天地周旋</p> <p>一生神机妙算 只有自己看不穿</p> <p>你荣华富贵在我 我生死有命在天</p> </div> </div> </div> </div> </div> </div> </div> <script type="text/javascript" src="js/zepto.min.js?1.1.11"></script> <script type="text/javascript" src="js/swiper/idangerous.swiper.min.js?1.1.11"></script> <script type="text/javascript"> $( //获取 Swiper轮播图 tabsSwiper = Swiper('.swiper-container' speed: 500 onSlideChangeStart: $(".tabs .active").removeClass('active' $(".tabs span").eq(tabsSwiper.activeIndex).addClass('active' $(".tabs span").on('touchstart mousedown', $(".tabs .active").removeClass('active' $().addClass('active' tabsSwiper.swipeTo($( $(".tabs span").click( }); </script> </body> </html>
It’s that simple, have you learned it?
The above is the detailed content of Introduction to Swiper's tabs. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics



Frequently Asked Questions and Solutions for Front-end Thermal Paper Ticket Printing In Front-end Development, Ticket Printing is a common requirement. However, many developers are implementing...

There is no absolute salary for Python and JavaScript developers, depending on skills and industry needs. 1. Python may be paid more in data science and machine learning. 2. JavaScript has great demand in front-end and full-stack development, and its salary is also considerable. 3. Influencing factors include experience, geographical location, company size and specific skills.

JavaScript is the cornerstone of modern web development, and its main functions include event-driven programming, dynamic content generation and asynchronous programming. 1) Event-driven programming allows web pages to change dynamically according to user operations. 2) Dynamic content generation allows page content to be adjusted according to conditions. 3) Asynchronous programming ensures that the user interface is not blocked. JavaScript is widely used in web interaction, single-page application and server-side development, greatly improving the flexibility of user experience and cross-platform development.

How to merge array elements with the same ID into one object in JavaScript? When processing data, we often encounter the need to have the same ID...

Discussion on the realization of parallax scrolling and element animation effects in this article will explore how to achieve similar to Shiseido official website (https://www.shiseido.co.jp/sb/wonderland/)...

In-depth discussion of the root causes of the difference in console.log output. This article will analyze the differences in the output results of console.log function in a piece of code and explain the reasons behind it. �...

Learning JavaScript is not difficult, but it is challenging. 1) Understand basic concepts such as variables, data types, functions, etc. 2) Master asynchronous programming and implement it through event loops. 3) Use DOM operations and Promise to handle asynchronous requests. 4) Avoid common mistakes and use debugging techniques. 5) Optimize performance and follow best practices.

Explore the implementation of panel drag and drop adjustment function similar to VSCode in the front-end. In front-end development, how to implement VSCode similar to VSCode...
