Help, cancelOn doesn’t work on Overscroll.js!

October 12, 2012

First off, overscroll is an amazing jQuery plugin. We used it as a way to make an explorable website that you can drag around to see all the different elements. However, the drag function would override when you click a form element. So it would try to drag the page instead of making the form field active to type into. It had a similar situation with scrollbars on the page…

This cause a headache. In the documentation, it the overscroll function includes the attribute “cancelOn”. Had this worked as intended, this would’ve been all I needed. But even while having the most current version, this still seemed to be an issue. Apparently you need to add the following to the beginning of the start function in the overscroll.js file

var $t=$(event.target), cancelOn=event.data.options.cancelOn
if ($t.is(cancelOn) || $t.parents(cancelOn).length) return true;

I found the solution here, but since it was solved 2 years ago, you’d think it’d be in the current release… o well….

Stay in Touch!

Subscribe to our newsletter.

Solutions Architecture

browse through our blog articles

Blog Archive