这篇文章将为大家详细讲解有关微信小程序scroll-view如何实现滚动到锚点左侧导航栏点餐功能?,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
代码如下:
先上效果图
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如何实现滚动到锚点左侧导航栏点餐功能?-创新互联
网站链接:https://www.cdcxhl.com/article36/dcdjsg.html
成都网站建设公司_创新互联,为您提供微信公众号、网站维护、用户体验、网站排名、品牌网站设计、软件开发
声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联