I'm trying to extract root path to current element in MultiLevelPushMenu plugin.
https://github.com/adgsm/multi-level-push-menu
owner has given Method to extract root level path onto document
/**
* Find path to root of selected menu level object
* Provides chain collection of menu level objects (root menu level object to given menu level object), or false in case of error
*/
$('#menu').multilevelpushmenu('pathtoroot', $menuLevelObject);
I've tried using same as per guidelines but I'm getting HTMLLiobject, but not able to dig down to path.
I need path into string format from this collection, any help?
here is my code..
$(document).ready(function(){
// HTML markup implementation, overlap mode
$( '#menu' ).multilevelpushmenu({
containersToPush: [$( '#pushobj' )],
menuWidth: '25%',
menuHeight: '100%',
onItemClick: function() {
// First argument is original event object
var event = arguments[0],
// Second argument is menu level object containing clicked item (
element)
$menuLevelHolder = arguments[1],
// Third argument is clicked item (
element)
$item = arguments[2],
// Fourth argument is instance settings/options object
options = arguments[3];
// You can do some cool stuff here before
// redirecting to href location
// like logging the event or even
// adding some parameters to href, etc...
var path = $('#menu').multilevelpushmenu('pathtoroot', $item);
alert(path);
}
});
});