Home >WeChat Applet >Mini Program Development >How to implement small ball navigation in a mini program (code)
The content of this article is about how to implement the navigation (code) of the small ball in the mini program. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
##wxml<!-- 导航 --><view class='navBox'> <view class='navBtn' wx:for="{{navBtn}}" wx:key="{{index}}"> <image class='navImg' src='' style='background:{{item.bgc}}'></image> <view class='navName'>{{item.name}}</view> </view></view>wxss
/* 导航 */ .navBox{ display: flex; flex-wrap: wrap; height: 450rpx; background: #fff; margin-top: 15rpx; padding: 20rpx 0; box-sizing: border-box; font-size: 9pt; } .navBtn{ width: 25%; text-align: center; padding-top: 15rpx; box-sizing: border-box; } .navImg{ display:block; width: 125rpx; height:125rpx; margin:0 auto; border-radius: 50%; } .navName{ padding: 10rpx 0; }js
Page({ data: { navBtn: [{ 'name': '模考题库', 'icon': '', 'url': '../tiku/tiku', 'bgc': '#5098D2' }, { 'name': '模考题库', 'icon': '', 'url': '../tiku/tiku', 'bgc': '#DA70A0' }, { 'name': '模考题库', 'icon': '', 'url': '../tiku/tiku', 'bgc': '#DF975C' }, { 'name': '模考题库', 'icon': '', 'url': '../tiku/tiku', 'bgc': '#95B1FA' }, { 'name': '模考题库', 'icon': '', 'url': '../tiku/tiku', 'bgc': '#77BF6B' }, { 'name': '模考题库', 'icon': '', 'url': '../tiku/tiku', 'bgc': '#F1E85B' }, { 'name': '模考题库', 'icon': '', 'url': '../tiku/tiku', 'bgc': '#EC5D55' }, { 'name': '模考题库', 'icon': '', 'url': '../tiku/tiku', 'bgc': '#A3619E' }, ] } })Related recommendations:
How to remove the small solid circle in the navigation bar_html/css_WEB-ITnose
Scrollable navigation effect at the top of the WeChat applet
Introduction to the method of realizing circular progress bar in WeChat applet
The above is the detailed content of How to implement small ball navigation in a mini program (code). For more information, please follow other related articles on the PHP Chinese website!