Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"disable" feature #3

Open
Antonimo opened this issue Jun 9, 2014 · 17 comments
Open

"disable" feature #3

Antonimo opened this issue Jun 9, 2014 · 17 comments

Comments

@Antonimo
Copy link

Antonimo commented Jun 9, 2014

"disable" feature would be nice, to disable, and turn off all event listeners, when needed.

@alvarotrigo
Copy link
Owner

Are you talking about a destroy function?

@Antonimo
Copy link
Author

Antonimo commented Jun 9, 2014

more disable/hide than destroy. For example: I want to show something different, with "normal" scrolling, then return to multiscroll.
Or if I want the page to be responsive, disable multiscroll on smaller screens. (a tabled going from portrait to landscape view and back )

@alvarotrigo
Copy link
Owner

Yeah, that's mainly a destroy function. As you have to unbind all the events used by the plugin.

@Antonimo
Copy link
Author

Antonimo commented Jun 9, 2014

or a if(disabled)return; in all event handlers... as a start ;)

@conormclav
Copy link

I was able to disable the listeners and allow the slideshow to run automatically

    $(document).ready(function() {
            $('#myContainer').multiscroll({
                verticalCentered : true,
                scrollingSpeed: 200,
                easing: 'easeInQuart',
                menu: false,
                sectionsColor: [],
                navigation: true,
                navigationPosition: 'right',
                navigationColor: '#000',
                navigationTooltips: [],
                loopBottom: true,
                loopTop: true,
                css3: true,
                paddingTop: 105,
                paddingBottom: 50,
                normalScrollElements: null, 
                keyboardScrolling: false,
                touchSensitivity: 5,


                        //events
                //afterLoad: function(id9, index){},
            });
        });






    $.fn.multiscroll({



            afterLoad: function (anchor, index) {

                setInterval(function() {

                        setTimeout(function(){
                           $.fn.multiscroll.moveSectionDown(); 
                        }, 700);

                 }, 4000);


            },
            afterRender: function(){


                setInterval(function() {

                        setTimeout(function(){
                           $.fn.multiscroll.moveSectionDown(); 
                        }, 700);

                 }, 4000);

            }
        });

 This will set an interval and run the function after 4 seconds, in this case

To disable the mouse scrolling

/**
         * Detecting mousewheel scrolling
         * 
         * http://blogs.sitepointstatic.com/examples/tech/mouse-wheel/index.html
         * http://www.sitepoint.com/html5-javascript-mouse-wheel/
         */
        function MouseWheelHandler(e) {

            return true;
        }

@Hrastopow
Copy link

+1 on that @Antonimo . I'm using your fantastic plugin @alvarotrigo, but have huge problems when the page needs to be rendered in mobile, since i have to enable normal scrolling instead of split scroll (or toggle between tablet portrait - normal scroll and landscape - split scroll)

I really have no idea, which event listeners to disable, in order to achieve that. Can you please help me?

@Antonimo
Copy link
Author

Antonimo commented Dec 2, 2014

the code isnt huge really, you can find all the events, there arnt many. Also look at the code above

@talgautb
Copy link
Contributor

see here #21

@dsgnco
Copy link

dsgnco commented Dec 30, 2015

I'm having an issue when using $.fn.multiscroll.build(); for click references

For instance:
$("a.gallery-click").click(function(){
$.fn.multiscroll.destroy();
});
Then:
$("a.gallery-close").click(function(){
$.fn.multiscroll.build();
});

This works, however when clicking the .gallery-close button, code inspector throws the error "Uncaught TypeError: ((m.event.special[e.origType] || (intermediate value)).handle || e.handler).apply is not a function"

Is there another way to go about preventing the page scroll on click?

Ideas?

@talgautb
Copy link
Contributor

talgautb commented Jan 4, 2016

@dsgnco may be:

$("a.gallery-click").click(function(){
  $('#multiscroll').multiscroll.destroy();
});

or check version of plugin

@dsgnco
Copy link

dsgnco commented Jan 4, 2016

@talgautb thanks, this is what I have implemented, the problem is on the click function to close, the multiscroll.build(); works but it throws an error in the web inspector "Uncaught TypeError: ((m.event.special[e.origType] || (intermediate value)).handle || e.handler).apply is not a function" and I cannot seem to locate the source of the error...

Just wanting to eliminate that js error in the web inspector.

@ghost
Copy link

ghost commented Jan 22, 2016

Is it possible to disable the mousewheel functions so that slides only change when you click the nav?

@alvarotrigo
Copy link
Owner

Is it possible to disable the mousewheel functions so that slides only change when you click the nav?

Yeah, use the function $fn.multiscroll.setMouseWheelScrolling(false). (not in the docs, but its there).

You can use it in the afterRender or even after the plugin's initialization.

@ghost
Copy link

ghost commented Jan 22, 2016

thanks, this works great however the navigation now doesnt change slides, when used on afterRender and on plugin initialization

@ghost
Copy link

ghost commented Jan 25, 2016

As a quick hack I've stopped the addMouseWheelHandler() call by commenting it out

@GaelJaboulay
Copy link

Hi there, I'd like also to stop the wheel navigation, either on the whole website, or on one specific section. I found that the addMouseWheelHandler is in the jquery.multiscroll.extensions.min.js but this is a js minified file that I was could download once the licence was paid. Any way to have a normal version of this file so that I make the wheel change? Should I "de" minify the file myself?

@alvarotrigo
Copy link
Owner

@GaelJaboulay if you want to disable the mouse wheel event just use the method $.fs.multiscroll.setMouseWheelScrolling(false); or $.fs.multiscroll.setKeyboardScrolling(false);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants