pixxelfactory / jInvertScroll

A lightweight jQuery vertical scroll - horizontal move plugin with parallax effect.
http://www.pixxelfactory.net/jInvertScroll
MIT License
786 stars 156 forks source link

how to cancel Efect #4

Closed mohamad-mehdi closed 11 years ago

mohamad-mehdi commented 11 years ago

hi ! i want to cancel all of the efects even page scrollbar and all of events by clicking on something is it possible ?

pixxelfactory commented 11 years ago

Hi,

yes, you can, first create the element on wich to click on, for example:

then, in your javascript block, add a click event to the button and remove the scroll and resize event from the window-element:

$('#disable').on('click', ,function(e) { e.preventDefault(); // only needed if element is a link, submit button or similar $(window).off('scroll resize'); });

If you want to re-enable it, you have to modify the plugin, since you need to re-bind the scroll and resize event to the scroll procedure.

Cheers pixxelfactory