当前位置:网站首页>[wechat applet] swiper slides the page, and the left and right sides of the slider show part of the front and back, showing part of the front and back
[wechat applet] swiper slides the page, and the left and right sides of the slider show part of the front and back, showing part of the front and back
2022-07-29 04:55:00 【Chang'an CC】

<!--pages/vip/vip.wxml-->
<view class="pageBox">
<swiper class="swiper" current="{
{currentTab}}" next-margin="50rpx" previous-margin="50rpx" bindchange="switchTab" style="width: 100%;height:400rpx;position: absolute;top:{
{40*2}}rpx;left: 0;z-index: 999;">
<block wx:for="{
{4}}" wx:key="index">
<swiper-item item-id="{
{index}}" data-item-id="{
{index}}" bindtap='clickChange'>
<view class='li'>
<image class="vipImg" src="/image/vip{
{index}}.png"></image>
</view>
</swiper-item>
</block>
</swiper>
<swiper class="tab-content" current="{
{currentTab}}" duration="300" bindchange="switchTab">
<swiper-item wx:for="{
{4}}" wx:key="index">
<scroll-view scroll-y="true" class="scoll-h">
<image class="bgImg" src="/image/vip{
{index}}Bg.png" show-menu-by-longpress></image>
</scroll-view>
</swiper-item>
</swiper>
</view>
/* pages/vip/vip.wxss */
page {
width: 100%;
height: 100%;
display: flex;
overflow: hidden;
background-color: #1a1728;
}
.pageBox {
width: 100%;
height: 100%;
overflow: hidden;
background-color: #1a1728;
}
.vipImg {
width: 95%;
height: 90%;
position: relative;
}
.vipImg:nth-child(4) {
width: 120%;
height: 90%;
position: relative;
}
.tab-content,
.bgImg {
width: 100%;
height: 100%;
}
.scoll-h {
height: 100%;
}
.scrollBox {
/* background-color: pink; */
height: 380rpx;
display: flex;
flex-wrap: nowrap;
width: 400%;
}
.vipCurrImg {
position: absolute;
top: 25%;
left: 48%;
width: 104rpx;
height: 40rpx;
}
.li {
width: 100%;
height: 90%;
display: flex;
align-items: center;
justify-content: center;
}
const app = getApp()
Page({
/** * Initial data of the page */
data: {
currentTab: 0, // Default the value of the current item
},
// Scroll to switch label styles
switchTab: function (e) {
console.log('swiper', this.data.currentTab);
console.log('swiper', e.detail.current);
this.setData({
currentTab: e.detail.current,
});
console.log(e.detail.current);
// this.checkCor();
},
边栏推荐
- How to debug UDP port
- JS daily question (12)
- Un7.28: common commands of redis client.
- Spark的算子操作列表
- [QT learning notes] * insert pictures in the window
- GCC Basics
- Download addresses of various versions of MySQL and multi version coexistence installation
- Big silent event Google browser has no title
- DataSourceClosedException: dataSource already closed at Mon Oct 25 16:55:48 CST 2021
- 怎样监测微型的网站服务
猜你喜欢

How to monitor micro web services

WPS插入超链接无法打开,提示“无法打开指定文件”怎么办!

C language implementation of three chess

1 sentence of code, get asp Net core binds multiple sources to the same class

Command line interactive tools (latest version) inquirer practical tutorial

如何避免示波器电流探头损坏

Common current limiting methods

MySQL定时调用预置函数完成数据更新

The most comprehensive promotion plan for the launch of new products

Use jupyter (2) to establish shortcuts to open jupyter and common shortcut keys of jupyter
随机推荐
SSM integration, addition, deletion, modification and query
Un7.28: common commands of redis client.
How to debug UDP port
How to avoid damage of oscilloscope current probe
un7.28:redis客户端常用命令。
Mysql各版本下载地址及多版本共存安装
Auto.js脚本开发入门
删除word文档中的空白页
office2010每次打开都要配置进度怎么解决?
Take you to understand JS array
Go面向并发的内存模型
Mujoco and mujoco_ Install libxcursor.so 1:NO such dictionary
Live in small private enterprises
excel怎么设置行高和列宽?excel设置行高和列宽的方法
【无标题】
Flink+iceberg environment construction and production problem handling
ios面试准备 - objective-c篇
Basic grammar of C language
Wechat picture identification
leetcode 763. Partition Labels 划分字母区间(中等)