Tagged: , , ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #20911

    Hi,

    I’d like to know if it is possible to remove the parent links who have children in the select menu.

    I have no link on some parent items so displaying them would be useless.

    Or perhaps, I could just display another menu item on mobiles only ?

    Thank you.

    #109634

    Hi,

    I think its possible but never done it. Please open up /js/avia.js and look for line 2133 that looks like

    var text = levelStr + $(this).clone().children('ul, ol').remove().end().text();

    and change it to something like this (levelStr is the indent)

    if ( levelStr.length > 0 ) {
    var text = levelStr + $(this).clone().children('ul, ol').remove().end().text();
    } else {
    var text = ' ';
    }

    Thanks,

    Nick

    #109635

    Hi Nick, it gives me an error : Uncaught TypeError: Object has no method ‘val’.

    #109636

    Hi,

    Please try this block below in the same file overwriting the code from before… lines 2131-2139 …. just match the starting and ending line , still in same file with the starting and ending line below.

    //get url and text for option
    if ( levelStr.length>0 ) {
    var link = $(this).find('a:first-child').attr('href');
    var text = levelStr+$(this).clone().children('ul,ol').remove().end().text();
    selectString+= '<option value="'+link+'">'+text+'</option>';
    }
    });
    selectString+= '</select>';

    Thanks,

    Nick

    #109637

    Hi,

    Thanks I will try your method but I already managed to make it work in this way :

    var i = 0;

    $(‘.mobileMenu’).find(‘option’).each(function(){

    if(i<20){ i++;}

    else{i = 1;}

    $(this).addClass(‘option-’ + i);

    });

    Then, in a js file I target the class I want to remove.

    #109638

    Hi,

    Excellent! Glad you found a smooth way of doing it!

    Thanks,

    Nick

Viewing 6 posts - 1 through 6 (of 6 total)

The topic ‘Hide/Remove parent page on mobile select menu’ is closed to new replies.