let _this=this
		   let height=""
		   const query = uni.createSelectorQuery()
		   query.select('#u-dropdown').boundingClientRect()
		   query.selectViewport().scrollOffset()
		   query.exec(function(res){
		    // debugger
		    res[0].top       // #the-id节点的上边界坐标
		    res[1].scrollTop // 显示区域的竖直滚动位置
		    // _this.height=res.windowHeight-res[0].top +'px'
		    // =_this.height
		    height=uni.getSystemInfoSync().screenHeight
		    _this.viewHeight=height-res[0].top-res[0].height
			_this.contentStyle={
				zIndex: -1,
				opacity: 0,
				height:_this.viewHeight+'px'
			}
		    // console.log('打印高度',_this.viewHeight);
		    // console.log('打印demo的元素的信息',res);
		   })
		  }

  

相关文章:

  • 2022-12-23
  • 2021-12-23
  • 2021-12-25
  • 2021-12-23
  • 2022-02-07
  • 2022-12-23
猜你喜欢
  • 2021-10-16
  • 2022-01-02
  • 2022-12-23
  • 2021-12-23
相关资源
相似解决方案