Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Select current page? #8

agileapricot opened this Issue · 3 comments

4 participants


Could a feature be added for the currently open page to be selected.

It would involve adding the class selected="selected" to the item if the URL matched the current page.


it's on my list of features to add... it's just finding time to add them ;-)


as a workaround, you can add the following lines after your call to mobilemenu:

var path = $(location).attr('pathname');
$('.mnav option[value="' + path + '"]').attr('selected', 'selected');


@malcomio just what I was looking for. :+1:

But if you only want to write with relative paths get the last part of the pathname (e.g.: index.html instead of /path/path/index.html) you can simply write

var pathArray = $(location).attr('pathname').split('/');
var path = $(pathArray).last()[0];
$('.mnav option[value="' + path + '"]').attr('selected', 'selected');

Not the best solutioun, if you have identical pathnames in subfolders and so on, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.