pagebeforehide and pagebeforeshow are returning undefined when referencing ui.prevPage and ui.nextPage. I have tried various different combinations since the documentation states that 'Note that all four of these events expose a reference to either the next page (nextPage) or previous page (prevPage), depending on whether the page is being shown or hidden', but nothing has worked thus far.
I can confirm this issue. I tried all four events and they all behave erratically when exposing the references to nextPage/prevPage.
'pagebeforeshow': nextPage is always undefined. prevPage is only defined if there is no prevPage (giving an empty jquery object as expected).
'pagehide': prevPage is always undefined. nextPage appears as expected
'pagebeforehide': both prevPage and next page are always undefined.
'pageshow': nextPage always undefined, prevPage works as expected
So, these are more consistent now, but the idea is that you'd bind to the div that's being shown or hidden, so "this" refers to the target, and nextPage or prevPage gives you the other page involved in the transition.
console.log(e.type + " " + ui.prevPage );
console.log(e.type + " " + ui.nextPage );
That said, the above tests out fine for me so I'm closing this as fixed. Let us know if you run into any issues given the explanation above and we'll be sure to document it better in the end.
Pass null event param for page _trigger beforehide and beforeshow -- …
…Fixes issue #700
Please update the documentation on this issue. The docs are still incorrectly stating that 'pagehide' event has the prevPage attribute. I had to search for a while to find this.