View RSS Feed

ddadmin

Updating Menu scripts for iPad/iPhone and Android devices

Rating: 86 votes, 4.35 average.
Mobile devices such as the iPad, iPhone or Android tablets are pretty on par with modern desktop browsers when it comes to rendering JavaScript, though that's not to say they do so without hiccups. One of the more crippling limitations is mobile devices' lack of support for the onmouseover/out events of JavaScript, which if you think about is more of a fundamental "shortcoming" of touch based devices in general rather than a deliberate act of omission. Regardless, this lack of support means many menu scripts on DD that rely on the onmouseover event to trigger the dropping down of a menu do not work in said devices. One way to overcome this so these menu scripts are at least functional in mobile devices is to modify them so when a mobile device is detected, the onclick event is used instead to trigger their associated drop down menus instead of the default onmouseover. I'm sure I'll be getting an earful on better ways to target mobile devices, for for now I'm using the following scheme:

Code:
var ismobile=navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i) != null, //boolean check for popular mobile browsers
I'll be going through relevant menu scripts on DD to add in the necessary modification so they are functional in the major mobile devices. The first two to get the treatment are:

June 28th, 11

1) Anylink Drop Down Menu
2) Anylink CSS Menu

July 1st, 11

1) Flex Level Popup Menu

July 2nd, 11

1) Flex Level Drop Down Menu

July 17th, 11

1) All Levels Navigational Menu

I'll update this list each time another menu script is updated. In general only the .js file in each case is affected unless noted otherwise. Feedback, suggestions, fire away!

Submit "Updating Menu scripts for iPad/iPhone and Android devices" to del.icio.us Submit "Updating Menu scripts for iPad/iPhone and Android devices" to StumbleUpon Submit "Updating Menu scripts for iPad/iPhone and Android devices" to Google Submit "Updating Menu scripts for iPad/iPhone and Android devices" to Digg

Updated 07-18-2011 at 06:35 AM by ddadmin

Categories
DD Scripts Mods

Comments

  1. Beverleyh's Avatar
    Thanks for tackling this issue ddadmin. I'm sure it will be a welcome upgrade to DD's already fantastic menu scripts.