


WeChat applet example: How to achieve the animation effect of the marquee (with code)
The content of this article is about the WeChat applet example: how to realize the animation effect of the marquee (with code). It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you. help.
1: Function introduction and explanation
The effect of the marquee (the title of the article is displayed in the marquee), and there is a button to view the article on the right side, the button is bound Determine the ID of the current ticker information. After clicking the button, jump to the corresponding article details page according to the ID;
The noteworthy point here is that I used the bindchange event of the swiper component to obtain the array of current information. Subscript, realizing the effect of dynamically changing the id value of the binding information of the view button;
2: Complete source code
1. Encapsulated into a component:
<!-- //滚动 --> <template> <block> <navigator> <view>查看</view> </navigator> <view> <text>公告</text> <swiper> <swiper-item> <view>{{item.title}} </view> </swiper-item> </swiper> </view> </block> </template>
.sx_lunbo { width: 100%; height: 60rpx; border-bottom: solid 1px #eee; } .chakan{ padding-left: 25rpx; right: 20rpx; clear: both; position:absolute; height: 40rpx; margin-top: 10rpx; color: #f63; border:solid 1px #f63; border-radius:5rpx; padding: 0rpx 10rpx 0rpx 10rpx; font-size: 28rpx } .sx_swiper { width: 550rpx; margin-top: 10rpx; } .sx_swiper swiper-item{ height: 40rpx } .reds { overflow: hidden; text-overflow: ellipsis; white-space:nowrap; width:500rpx; font-size: 28rpx; height: 40rpx; } .red { font-size: 24rpx; color: white; width: 60rpx; height: 40rpx; line-height: 40rpx; background: blue; padding-left: 10rpx; margin: 10rpx; border-radius: 10rpx; }
2. Call on the page:
<import></import> <template></template>
@import "../template/roll/roll.wxss";
newsId: function (e) { var that = this var item = e.detail.current; this.setData({ newsId:that.data.news[item].id }) },
3.news data:
WeChat Mini Program Example: Collection and unfavorite pictures and the functional effects of switching pictures
WeChat Mini Program Example: How to implement a sliding selector (with code )
The above is the detailed content of WeChat applet example: How to achieve the animation effect of the marquee (with code). 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

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

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

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool