1

I have implemented parallax on a website by following the tutorial posted on the below link which uses stellar.js and iScroll for mobile : http://markdalgleish.com/2012/10/mobile-parallax-with-stellar-js/

Everything looks good and parallax also works but the problem is that the external links that are in the page cannot be opened on iPad and mobile devices. I was using iScroll 4 so I upgraded to iScroll 5 and adjusted the initialization calls to iScroll 5 accordingly. Now the links open in those devices also but the performance is unbearably slow. Is there any way to make external links open while using iScroll 4 or make the performance better while still using iScroll 5?

SUB0DH
  • 5,130
  • 4
  • 29
  • 46

1 Answers1

0

Apparently iScroll has some event handlers on clicking any elements inside the wrapper. So I added the code to ignore clicks to any anchor tags along with select, input and textarea in the onBeforeScrollStart parameter.

In order to do so replaced iScrollInstance = new iScroll('wrapper'); with the following code:

iScrollInstance = new iScroll('wrapper', {
                    handleClick: true,
                    onBeforeScrollStart: function (e) {
                        var target = e.target;
                        if (target.tagName != 'A' && target.tagName != 'SELECT' && target.tagName != 'INPUT' && target.tagName != 'TEXTAREA')
                                e.preventDefault();
                    }
                });
SUB0DH
  • 5,130
  • 4
  • 29
  • 46