Small micro-channel user listens slide fell on the event

Today, to be made a function of displaying different content based on the user's falling or sliding,

Ideas: first user is listening on the slider or falling, to change the data in the data determining module displays hidden variables monitored results, the use of two modules to be switched two hidden, two data variables defined to accept the change true or false

page

hidden='{{bottom}}'
hidden='{{top}}'
 
data{
// Initialize state 
top:true,
bottom:false,
}
 
// determine the browser scroll bar to scroll up and down
if (t.scrollTop > a.data.scrollTop || t.scrollTop == wx.getSystemInfoSync().windowHeight) {
the console.log ( 'scroll down');
// change the display status hidden
a.setData({
bottom: true,
top: false
})
console.log(a.data.bottom)
} else {
the console.log ( 'scroll up');
a.setData({
 
bottom: false,
top: true
})
console.log(a.data.bottom)
}

Guess you like

Origin www.cnblogs.com/lishuang2243/p/11004184.html