這篇文章將為大家詳細講解有關微信小程序scroll-view如何實現(xiàn)滾動到錨點左側導航欄點餐功能?,小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。

代碼如下:
先上效果圖
1.wxml代碼:
<view class="page">
<import src="../../components/catering-item/catering-item.wxml" />
<!-- 左側滾動欄 -->
<view class='under_line'></view>
<view class="body">
<view style='float: left' class='left'>
<scroll-view scroll-y scroll-with-animation scroll-left="{{scrollLength}}" class='scrollY' style='height: {{winHeight}}px'>
<view class='all clear'>
<block wx:key="tabs" wx:for="{{tabs}}">
<view bindtap='jumpIndex' data-menuindex='{{index}}'data-anchor='{{item.anchor}}'>
<view class="text-style {{indexId==index?' activeView':''}}">
<text class="{{indexId==index?'active1':''}}">{{item.title}}</text>
</view>
</view>
</block>
</view>
</scroll-view>
</view>
<view class="right" style='height: {{winHeight}}px'>
<scroll-view scroll-y scroll-with-animation scroll-left="{{scrollLength}}" bindscroll="scrollToLeft" scroll-into-view="{{toTitle}}" class='scrollRight' style='height: {{winHeight}}px'>
<block wx:key="tabs" wx:for="{{tabs}}">
<view id="view-{{item.anchor}}">
<view class="title" id="title-{{item.anchor}}">{{item.title}}</view>
<view class="orders" wx:for="{{tabsList[item.anchor]}}">
<template is="cateringItem" data="{{...item}}" />
</view>
</view>
</block>
</scroll-view>
</view>
</view>
</view>
新聞標題:微信小程序scroll-view如何實現(xiàn)滾動到錨點左側導航欄點餐功能?-創(chuàng)新互聯(lián)
網(wǎng)站鏈接:http://www.chinadenli.net/article36/dcdjsg.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供微信公眾號、網(wǎng)站維護、用戶體驗、網(wǎng)站排名、品牌網(wǎng)站設計、軟件開發(fā)
聲明:本網(wǎng)站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)