javascript - How to achieve sliding switching on the mobile page, so that it can slide from 1 to 2 but cannot slide back from 2 to 1?
为情所困
为情所困 2017-05-16 13:44:42
0
2
521

The first page is the guide page and the second page is the home page. Swipe up on the first page on the mobile phone to display the second page (home page). After entering the home page, you cannot slide back to the first page. Tried swipe but it didn't solve the problem? May I ask how to solve it?

为情所困
为情所困

reply all(2)
我想大声告诉你

There are many ways, such as hiding or deleting the number one after sliding it from one to two.

Essentially, it is to prevent the process of sliding back from two to one.

洪涛

The library that encapsulates the complete pair should be able to set up hooks for you. Take a look at the documentation and see if there are any methods like
beforeSwipe or shouldSwipe
The simplest is to set a variable and set it to false after triggering;
var swipable = true;
function swipe(e) {

if ( !swipable ) return e.preventDefault();
swipable = false;

}

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template