Get the App
SLTechnology News&Howtos  ›  Development  › 

How to achieve the effect of five-star scoring by WeChat Mini Programs

Shulou Source: shulou.com Published: 2022-05-31 21:16:34 09月28日 Update

This article mainly introduces the relevant knowledge of how to realize the five-star scoring effect of Weixin Mini Programs (Mini). The content is detailed and easy to understand, the operation is simple and fast, and it has certain reference value. I believe everyone will gain something after reading this article on how to realize the five-star scoring effect of Weixin Mini Programs. Let's take a look at it together.

Weixin Mini Programs (Mini) Five-Star Rating Effect Implementation Code

So here's what happens when the score is 0, 0.5, 1,

Then the code:

js:

function pingfenxing(pingfen){ var that=this, //here is the path of the picture, you need to change it yourself data={ ling:"img/pingfen0.png", zheng:"img/pingfen2.png", ban:"img/pingfen1.png" }, nums=[];//Here is an array that returns the order of the images. Note the path of the images when the page is used, but it doesn't matter if you use network images. if((pingfen/0.5)%2==0){//If the score is an integer, such as 4.0, 5.0 for(var i=0;i

Tags: Pictures ratings representatives pages effects programs five stars data put code integers knowledge content parameters that is arrays times articles paths order Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux Shulou Tech Info MariaDB MySQL Xiaomi