cordova - Onsen UI Navigator from Jquery -
i had navigator interacts pages. trying use jquery instead onf angular. googling had found solution modify selected page html code:
ons.ready (function (){ $(document).on('ons-navigator:postpush', 'ons-navigator', function(event) { //do }); });
how set specific html page(because code above page navigator changes to).
thank in advance
check postpush
event in onsen ui docs: http://onsen.io/reference/ons-navigator.html#event-postpush
there useful parameters can use such event.enterpage
, event.leavepage
.
also, can current page mynav.getcurrentpage()
and entire page stack mynave.getpages()
. more info in previous link.
hope helps!
edit:
looks original event wrapped in object.
ons.ready (function (){ $(document).on('ons-navigator:postpush', 'ons-navigator', function(event) { event = event.originalevent; // console.log('from',event.leavepage.name, 'to', event.enterpage.name); }); });
working here http://codepen.io/frankdiox/pen/domdbw
Comments
Post a Comment