Ons-splitter-side swipeable disable

  • Hey there!

    I switched from ons-sidebar to ons-splitter-side to make it easier to support tablets.
    However I have a question:

    On my login screen I don’t want to show the splitter-side. For now I use this

    window.enableMenu = function(swipeable){
        var menu = document.getElementById('menu');
        var content = $('#content');
        if (swipeable){

    But I find this very ugly :S.

    Any idea’s on how to make this more cleaner? Maybe there is a build in alternative?

    PS: This is my splitter

            <ons-splitter-side id="menu" animation="overlay" side="left" width="260px" swipeable collapse="screen and (max-width:31.25em)" page="html/menu.html">
            <ons-splitter-content id="content" page="html/login.html">


  • Onsen UI

    @Maxim-Van-de-Wynckel Just remove the swipeable attribute :)

  • how to remove the swipeable attribute with js? Im going nuts over it, what ever I do it doesnt work:

    $(’#menu’).removeAttr('swipeable ');

    why its not working?

  • @Maxim-Van-de-Wynckel I think what @Fran-Diox means, is to do this:

            <ons-splitter-side id="menu" animation="overlay" side="left" width="260px" collapse="screen and (max-width:31.25em)" page="html/menu.html">
            <ons-splitter-content id="content" page="html/login.html">

    No JS, just remove it from the tag.

  • @munsterlander i need to disable the menu in some pages, thats why need to do it with js, otherwise it’ll be disable in all pages

Log in to reply