Detailed explanation of the scrolling tab effect of the ScrollTab component of the WeChat applet YDUI

小云云
Release: 2018-02-03 09:15:41
Original
3348 people have browsed it

This article mainly introduces to you in detail the ScrollTab component of WeChat applet to implement YDUI and the scrolling tab effect. It has certain reference value. Interested friends can refer to it. I hope it can help everyone.

DEMO download

Rendering

YDUI’s ScrollTab (scrolling tab)

WXML


   {{item}}       {{item}} {{item}} 列表 {{index}}   
Copy after login

WXSS


.tui-fixed-x{ margin-left: 130px; position: fixed; top: 0; left: 0; } .tui-fixed-left{ width: 120px; height: 100%; border-right: 1px solid #dfdfdf; position: fixed; background-color: #f5f5f5; top: 0; left: 0; } .tui-list-head{ background-color: #fff; margin-bottom: 15px; } .tui-city-scroll{ width: 100%; } .tui-nav-li{ font-size: 30rpx; padding: 0 10px; height: 100rpx; line-height: 100rpx; width: 100px; display: block; border-bottom: 1px solid #dfdfdf; position: relative; z-index: 10; } .tui-nav-active{ background-color: #fff; } .tui-fixed-y{ margin-left: 120px; padding-left: 10px; padding-right: 10px; height: 100%; position: fixed; bottom: 0; right: 0; } .tui-city-scroll-y{ height: 100%; box-sizing: border-box; } .tui-list-head{ height: 50px; line-height: 50px; text-align: center; font-size: 30rpx; color: blue; } .tui-list-li{ height: 400px; padding: 10rpx; color: #fff; font-size: 50rpx; background-color: lightgreen; }
Copy after login

JS


##

Page({ data: { navList: ['今日特惠', '烟灶推荐', '净水饮水推荐', '洗碗机推荐', '电热推荐', '燃热推荐', '消毒柜推荐', '嵌入式推荐', '商用电器', '活动说明'], status: 0 }, getStatus(e) { this.setData({ status: e.currentTarget.dataset.index }) } })
Copy after login

Summary

The implementation principle and processing method are the same as the WeChat applet - the ScrollNav component that implements YDUI. The subtle difference is that the WXSS style sheet has been changed!

Related recommendations:


Two jQuery methods to implement the tab function

Detailed explanation of the JavaScript plug-in Tab

jquery implements tab switching effect

The above is the detailed content of Detailed explanation of the scrolling tab effect of the ScrollTab component of the WeChat applet YDUI. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!