| | |
| | | let that = this; |
| | | let query = this.createSelectorQuery(); //必须要先创建一个查询 |
| | | query.select(element).boundingClientRect(function (rect) { |
| | | if (that.data.pageheight) { |
| | | let pageheight = that.data.pageheight.split('px')[0] |
| | | pageheight = parseInt(pageheight) |
| | | if (rect.height > pageheight) { |
| | | // if (that.data.pageheight) { |
| | | // let pageheight = that.data.pageheight.split('px')[0] |
| | | // pageheight = parseInt(pageheight) |
| | | // if (rect.height > pageheight) { |
| | | // that.setData({ |
| | | // pageheight: rect.height + 'px' |
| | | // }); |
| | | // } |
| | | // } else { |
| | | // that.setData({ |
| | | // pageheight: rect.height + 'px' |
| | | // }); |
| | | // } |
| | | that.setData({ |
| | | pageheight: rect.height + 'px' |
| | | }); |
| | | } |
| | | } else { |
| | | that.setData({ |
| | | pageheight: rect.height + 'px' |
| | | }); |
| | | } |
| | | }).exec(); |
| | | }, |
| | | swichNav: function (e) { |