AidanZealley / off.canvas

Off canvas style HTML, CSS and javascript framework
147 stars 24 forks source link

Can't get the swiping to work. #14

Open pgroot91 opened 9 years ago

pgroot91 commented 9 years ago

Hallo everyone,

I'm trying to get the swiping functionality to work but it looks like it's broken somehow?

What code triggers the swiping functionality?

I found the problem is does not work nice/conflict with materialize.js from http://materializecss.com/

Thanks!

Patrick

helloromero commented 8 years ago

The code is in the jquery.offcanvas.js file the code is the following...

        if (settings.enableTouch) {

            $(this).hammer({drag:false, prevent_default:false, css_hacks:false}).on('swipe', function (event) {
                if (event.direction === 'right') {
                    if (!slidRight && !slidLeft && settings.hasSidebarLeft) {
                        slide('right');
                    } else {
                        slide('shutRight');
                    }

                    return false;
                } else if (event.direction === 'left') {
                    if (!slidRight && !slidLeft && settings.hasSidebarRight) {
                        slide('left');
                    } else {
                        slide('shutLeft');
                    }

                    return false;
                }
            });
        }