in5 Answers archive · asked 2018-02-13 · 1 answer

Prevent Swipe Navigation by Excluding Pages

swipenavigationexcludepages

Hi Justin,

Related to this question, if I want only the first page to be allowed to swipe but the rest of the pages don't, how would you recommend to write the code?

in5 user · 2018-02-13 · 3,519 views

1 answer

Accepted answer

You can modify the page filter thusly:

.page[data-name!="1"]

"!=" means "not equal to"-- so it will exclude all pages except the first one.

Here's the entire snippet from the other post with the adjustment:

$(function(){
    $('#container').swipe({excludedElements:$.fn.swipe.defaults.excludedElements+=',.page[data-name!="1"]'});
});

in5 team · 2018-02-13

Thank you so much Justin.

Just to confirm, I enter this code in the JavaScript area in the resources tab of the In5 window, correct?

in5 user · 2018-02-14

Hi Justin, I tested the .js file with the code you gave me and it works like a charm!!!

Thank you so much!

You never cease to amaze me with all your great support and your always prompt response.

Keep up the good work! Our company is loving the In5 tool!

Ed

in5 user · 2018-02-14

Happy to help, Ed!

So glad to hear that your company is loving in5. :-)

in5 team · 2018-02-14

Was this useful?