Welcome to the in5 Answer Exchange! This a place to get answers about in5 (InDesign to HTML5) and make requests.
+3 votes
first of all I'd like to say this really looks like a great project. As it matures I am definitely going to buy a few licenses.

My question: are you considering to use something like iScroll to get a real smooth scrolling/swiping experience?

Keep up the good work,
in feature_requests by (430 points)
Thanks, Wim. Are you interested in iScroll for scrolling text, or the entire navigation of the pages?
Hi Justin, I am interested in using it for the entire navigation of the pages. I generated a horizontal slider test doc and tested its use on an iPAD. I noticed it is a lot less smooth than iScroll (seems to be used in quite a few places). Hence my request for consideration.
Kind regards,
Thanks for the clarification. We'll keep iScroll in mind going forward.
I have replaced anythingslider with iScroll4 after generating the code, just to show what I mean ;).
It is not difficult to do, but the resulting "swipe smoothness" is much closer to the expected iPad behavior.
Very small demo:

PS 1.3 is a great release :)
Cool! Thanks for putting this together!

1 Answer

+1 vote
Best answer

This will be integrated into the default code at some point in the future after we've done more testing, but for now, you can export a Slider with swipe enabled and attach the following code as a .js file in the Resources section of the in5 dialog to create a "smooth" swipe:

  var pageWidth = parseInt($(".page").width());
  var pageChangeThreshold = pageWidth*.33;
  var pageWrap = $('.pages'), startPos, vertMode = false,
  nextProp = 'left', backProp = 'right', moveProp = 'left';
  var cancelSwipe = function(){
          allowPageScroll: (vertMode ? 'horizontal' : 'vertical'),
excludedElements:$.fn.swipe.defaults.excludedElements+',.mejs-overlay-button,map,[onclick],[data-useswipe="1"],[data-tapstart="1"], .panzoom,.scroll-horiz',
        swipeStatus:function(event, phase, direction, distance, duration, fingers) {
                case 'start':
                    startPos = parseInt(pageWrap.css(moveProp));
                case 'end':
                    if(distance > pageChangeThreshold){
                            case nextProp:
                                if(nav.current < nav.numPages) nav.next();
                                else cancelSwipe();
                            case backProp:
                                if(nav.current > 1) nav.back();
                                else cancelSwipe();
                    } else {
                case 'move':            
                        case nextProp:
                            pageWrap.css(moveProp, (startPos-distance)+'px');
                        case backProp:
                            pageWrap.css(moveProp, (startPos+distance)+'px');
                case 'cancel':


by (197k points)
selected by
Great, thank you! I will be testing it when I have some time.

Kind regards,

PS I did get those licenses and the upgrade, just to support the good work :)
Thanks Justin! I was waiting for this a long time!


Also the DPS overlay export will be really useful for us. Looks like we can finally end the testing phase and start producing with in5. ;)

We need it more as extension for the Digital Publishing Suite then as replacement. Therefore every step you take to integrate it further with DPS, will be very helpful.

Kind regards,
Thanks for the feedback, Toni. Sorry this took so long!
Thanks, Wim!
Still working fine. With a smaller "pageChangeThreshold" and linear easing it's as smooth as DPS :)
Glad to hear it!
This might be a dumb question, but how do you set the easing to smooth in this script? My JS skills are nonexisting :(
It's in the animate function. Reference:

I think you'd need to add JS to modify the animationTime setting. E.g.,

sliderSettings.animationTime = 600;

600 milliseconds is the default, so change that number to make it slower or faster.

I'm not sure what you mean by the "vertical floating"...are the pages varying heights?

Thanks for the video. That's very helpful! That up and down movement is default for iOS. I don't think there's safe way to override that with CSS or JavaScript.
No, requires this extra code.
Sorry, no idea. Since this is not an official feature, it has not been thoroughly tested.