Hi, I would like to have a "select" style option that convert the ul menu in a select menu like this.

<select>
<option>Link1</option>
<option>Link2</option>
</select>

Is there a reason why I can't find any module with that feature?
Actually I use the jquery.mobilemenu.js technic but it doesn't work on a page that load a video from project/mediafront module.

Thank you!

Comments

deggertsen’s picture

Title: select menu option » responsive select menu option

I did what you want to do by adding the following code to my template.php file. You have to add the jquery.mobilemenu.js (https://github.com/mambows/mobilemenu) to your theme's js folder as well. It would be good to have some responsive themeing like this build into Nice Menus.

<?php

/**
 * Add Javascript for responsive mobile menu
 */
drupal_add_js(drupal_get_path('theme', 'parenting') .'/js/jquery.mobilemenu.js');

drupal_add_js('jQuery(document).ready(function($) { 

$("#navigation #main-menu > ul").mobileMenu({
	prependTo: "#navigation",
	combine: false,
	switchWidth: 900,
	topOptionText: "Navigate to..."
});

});',
array('type' => 'inline', 'scope' => 'header'));
//EOF:Javascript

?>

Obviously you can change the width at which the site changes the menu to a select menu and you can change the top option text.

deggertsen’s picture

Oops, I posted the wrong link to the mobilemenu javascript library. Here's the correct one. https://github.com/mattkersley/Responsive-Menu

tripper54’s picture

Issue summary: View changes

@deggertsen, thanks for the heads up, that's a great little library. It solved my problem perfectly.

Someone should make a module for it...

:)

xiukun.zhou’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.