如果页面内容不足以产生滚动条,那么uni.pageScrollTo自然无法生效。 检查是否有CSS样式(如overflow: hidden)阻止了滚动。 确认页面加载状态: 确保页面已经完全加载后再调用uni.pageScrollTo。可以在页面的onLoad或onReady生命周期函数中调用,或者使用this.$nextTick确保DOM更新完成后再执行滚动操作: javascrip
uni.pageScrollTod的作用:将页面滚动到目标位置。 设置以下代码,不起效: uni.pageScrollTo({ scrollTop:999999, duration:0,//间隔时间success() { console.log('成功'); }, fail() { console.log('失败'); } }) 解决方案: 1、在外面套层 定时器 setTimeout(()=>{ uni.pageScrollTo({ scrollTop:...
大概有两种方式,一种是使用 uni.pageScrollTo 方法; 另一种是使用scroll-view 标签的属性:scroll-top(距离值 num) 或 scroll-into-view(子元素的id,不能以数字开头 string); 两种方式的前提是:提供具体的高度值(scroll-view 也可以横向滚动到指定位置)。 一、uni.pageScrollTo uni.pageScrollTo 不起效果的原...
uni.pageScrollTo失效 前⾔: ⼤概有两种⽅式,⼀种是使⽤ uni.pageScrollTo ⽅法; 另⼀种是使⽤ scroll-view 标签的属性:scroll-top(距离值 num) 或 scroll-into-view(⼦元素的id,不能以数字开头 string); 两种⽅式的前提是:提供具体的⾼度值(scroll-view 也可以横向滚动...
一旦出错也会造成uni.pageScrollTo失效 1.scroll-view中不设置顶部会造成列表信息循环滚动,同时onPullDownRefresh方法失效 2.在iOS中会有fixed定位在底部失效的问题,此时需要把content的view设置为absolute,footer的view设置为fixed。这样在滑动content的滚动条时就不会带着下部fixed定位的view一起滑动 ...
多谢回复,我在官方的demo里面 tabbar.nuve这个文件里面,修改下面这个函数,可以打印log,但是pageScrollTo不工作 ontabtap(e) { let index = e.target.dataset.current || e.currentTarget.dataset.current; this.switchTab(index); uni.pageScrollTo({
nodeper2楼 ht
htzhanglong3楼
问题描述 使用uni.pageScrollTo在移动端H5的页面滚动时,输入的duration为0时、scrollTop不为0,页面不会滚动到目标位置,而是直接滚动到顶部 复现步骤 如上描述 uni.pageScrollTo({ scrollTop: 300, duration: 0, success(res) { console.log('scroll res--->', res) },
uniapp pageScrollTo滚动到1276之后不滚动了我这边复现的问题就是:页面滚动在1276之前,页面是没有问题的。但是如果滚动的距离超过了1276,则从消息页面返回到消息列表页面时,则页面只会滚动到1276,不会继续向下滚动了。 咨询了一个大神之后,被臭骂一顿,嗯,就一个消息的已读未读,可以不调用接口,直接自行处理即可。