How do I edit jQuery.mmenu.js to allow classes (not only IDs) to be targeted? -


i'm working on mobile site , want reveal hidden submenus underneath divs twitter's mobile site (swipe tweet reveal other options). interface in jquery.mmenu.js plug-in, it's limited target ids , need target classes.

i'm sure set-up fred, means theoretically changed.

the code can downloaded here: http://mmenu.frebsite.nl/

ps. post intended fred per contact requirements, if can think of solution i'd love try it.

this should work well:

$('.classselector').mmenu(); 

only real issue plugin binds dragging events "page". therefor opening menu dragging across page limited 1 menu per direction ("left","right", "top", "bottom").

i guess relatively easy change plugin can bind dragging events specified element (via configuration) fallback "page". until implemented in official plugin, try this:

for ( var = 0; < 10; a++ ) {     $(".menu" + a).mmenu({         dragopen :{             open: true,             pagenode: $(".tweet" + a)         }     }); } 

open unminified jquery.mmenu.js file, go $.fn.mmenu.dragopen method (on line 454) , add:

var $dragnode = ( opts.pagenode && opts.pagenode instanceof $ ) ? opts.pagenode : $page; 

go line 530 , change:

$page.hammer() 

into

$dragnode.hammer() 

i think should trick.


Comments

Popular posts from this blog

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -