jquery mobile - how detect page top - jquery-mobile

I want to know how much of page is scrolled.
I tried this code not helped me:
$('html').offset().top
also:
$(window).scrollTop()

Related

jQuery Mobile + FullCalendar - need to refresh page to see it with multiple page divs

Please see this jsbin test page that illustrates the issue
I have a simple jqm page with two page divs. The only initialization is being done inside a $(document).on('pageshow', function(){}); block. Inside the block, I initialize a fullcalendar.js calendar.
If I load the page as an external page (the first link in the menu) it loads without a hitch (but it's not using ajax, so the page flickers and there's no transition).
If I load the page using the jqm convention of linking to the id of the second page div with an anchor tag, it loads the calendar div as a page with no data.
If I then refresh the page, the data is displayed. Subsequent use of the menu displays both page divs as pages without issue.
I've seen a lot of discussion about which event of the pagecontainer widget to use, and I'm aware that document.ready() is not the way to go. I've tried all the possibilities, I think (pagebeforeshow, pageshow, pageinit, etc.) There's more detail in the demo, where you can see all the code. If I need to post it here, too, I can do that, but it's easier to see the issue if you load the test at jsbin. I suggest running it in a separate window, so you can refresh the page.
If anyone else has solved this or has an idea what I'm doing wrong, I'd really appreciate the help and / or suggestions.
I put all of the pagecontainer events into my test jsbin code and stepped through them. (Thanks to Gajotres for providing useful documentation on the various pagecontainer hooks). It turns out that the one I needed was 'pagecontainerhide' instead of pageshow, pageinit, or any of the others. Once I modified the code to use that event, the calendar displayed properly on the page div, with transition, and I no longer had to click on refresh to see load the "page".
Since I have all the events there, perhaps others with page change issues can benefit from the test page....

jQuery UI Draggable scroll issue

The problem with my function is that when I scroll down, the clone of the element I want to drag is positioned under my mouse pointer, this only happens in FF, IE and Safari, Chrome works like it should.
I already tried all answers on this question :
jQuery draggable shows helper in wrong place after page scrolled
But without succes,
I use jQuery 1.8.3 & jQuery UI 1.10.3
hopefully anyone has any idea on how to fix this.
You can view a live version of my webpage here : http://www.solar-sell.eu/uw-pv-systeem/?gezin=true
The people are the draggable elements and the house is the drop area.
Thanks in advance!
It seems to me that the problem is a jQuery UI bug - http://bugs.jqueryui.com/ticket/9315

jQuery Mobile popup that doesn't move when scrolling the page

I am using jQuery Mobile 1.3.0 RC1. I have a popup that I create programmatically at the bottom of my page and close after a few seconds using setTimeout (toast notification). It works very well, however if I happen to scroll the page while the popup is displayed, the popup gets scrolled too. I would like the popup not to move, i.e. stay in its position relative to the screen, not relative to the page. Is there a way to do that ?
I have tried playing with the data-position-to attribute in the HTML element, with the positionTo option of the "open" method, and tried placing the popup element inside a fixed transparent footer, none of these resulted in the desired behavior.
I had a similar problem last week. Finally solved it using modal dialog instead of popups.
For popups, I could find following.
$("#myPopup").on({
popupbeforeposition: function () {
$('.ui-popup-screen').off();
}
});
Which helped me in prevention of closing the dialog while user touched outside of popup. But scrolling issue was still there. So I changed all popups to modal dialogs. Hope it helps someone.

jquery mobile splitview plugin, transition from a non-split page to a split page

I´m using jquery mobile for an iPad app, and I wanted to have the typical splitview layout so I used the splitview plugin which is working fine until now, but I would still have some minor questions:
Can my first page be a normal page, meaning non-split and then when for example I click on a button go to the second page which would be split?
How do I do to enlarge the left panel if I find it a bit narrow?
Thank you for your help.
I am having the same issue.
I am able to workaround this by providing rel="external" on the link in my navigation menu. This however reloads the entire page, and the ajax effect is gone.
<li>Some Text</li>
I will be spending some time on it this weekend to get it working through ajax, will let you know if I find a solution.

links not working in ipad /iphone

We're trying to put a fixed navigation to scroll the different sections of a page.
i have 3 links to link to different sections of the same page. and the position of the div containing this links are fixed.i am caling a function when that link clicked.
We're using jquery scrollTo().to scroll.it is wrking fine on desktop applications.
Only on ipad, the first click pass without problem, but after this one, the on the navigation seems to be disabled. If we scroll, even a little bit, with the hand, then the link's work again.
I used:
$(window).scrollTop($(window).scrollTop() + 1);
$(window).scrollTop($(window).scrollTop() - 1);
ofter scrollto but no luck....
Please help me
Jquery mobile anchor linking will prevent you from doing that. you might have to write a custom js to do the scroll.
More here -
https://forum.jquery.com/topic/jquery-mobile-anchor-linking

Resources