jQuery Mobile UI problems on 2nd level pages - jquery-mobile

I have a project that is five pages: 1 landing and 4 second level pages. I'm using page transitions, panels, and popups. The issue I have is that things like popups and panels work on the landing page but when I navigate to the second level pages, popups and panels don't work. I don't have any errors in console. If I navigate directly to the second level pages, they work. It seems as though navigating to the subpages does not activate some of the JS or code necessary.
Unfortunately, it's on a closed network for a client so I can't upload an example. Any ideas or has anyone run into this? I know that jQuery will only fire JS that's within the data-role="page" tags.
Thanks.

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 mobile separate HTML page change when swipe

I have made 3 different html pages and I set anchor as [data-ajax="false"] to move another page.
Is there any way to change the page when swipe left or right ?
Also How do I set page change transition ?
page1
page2
page3
Why not use SlideMe (http://slideme.luigiferraresi.it/) ?
There are many jQuery slideshow plugins and it is usually hard to decide which one is better.
SlideMe is a responsive jQuery slider. It is done using CSS3 and works smoothly even in IE7. It is easy to install and has full screen option.
I use this plugin (which I modified a little) and I'm satisfied.
Nicolas

Swiping to see next or previous pages on mobile devices

My client wants a website specifically for iPads containing 3 pages. Instead of a menu to navigate between these pages, he wants to swipe leftward / rightward anywhere on the screen to see the next page or the previous page. The 3 "pages" of the site would then be div elements belonging to the same html page, with only the one corresponding to the current "page" being visible. The markup would look like this:
<div id='page1'>
content page1
</div>
<div id='page2' class='current'>
content page2
</div>
<div id='page3'>
content page3
</div>
I did find a few little solutions here and there (for example this one) but nothing very established/popular. Am I missing something, is there a reliable and easy way to swipe between pages on mobile devices?
If you want something "established", there's Dojo mobile:
http://dojotoolkit.org/features/mobile
I've used it before. The only problem I've found is it's built by default to adapt the look of your site to match the look of the OS of the device it's being displayed on (which is totally under your control whether you want to use their CSS, I just don't like the idea.)
EDIT:
On that note if they want a "website specifically for iPads" why not just build an iPad app? Websites are not meant for any single particular device to be viewing them.

Jquery mobile - Delay auto hiding address bar

I've happily developed a mobile website using JQuery Mobile, and everything works beautifully except for a noticeable delay hiding the browser address bar on the homepage (around 5 seconds on iOS Safari).
AJAX transitions mean it's always hidden from that point on, but on the opening page the site logo is hidden for up to 5 seconds after the page has loaded, giving it a very unbranded and confusing feel for the user.
Can anyone think of any reasons for the delay / ways to speed it up? There are no large images loading on the page, putting an alert in the window load event fires way before the address bar is hidden and the setTimeout delays on the code firing in the JQuery Mobile code are only of the order of 20 ms.
Thanks in advance, Ted
I use Mobile Boilerplate's MBP.hideUrlBarOnLoad() and am not experiencing a five second delay.
Hide URL Bar
MBP.hideUrlBarOnLoad is used to hide the URL bar at the top of mobile
Safari on your iOS. Mobile space is limited and this helps to leverage
every pixel on the screen to maximize display area.
Sadly I've had to resort to a pretty hacky solution to this.
I've added a dummy 60px high spacer div at the top of the page, which pushes down the title, so it is visible at all times. This is then hidden by Javascript after 5 second setTimeout call, which is roughly equivalent to the delay we get on the url bar being auto-hidden by JQuery mobile.
This is only necessary on the start page, and other ones that we've had to load on rel="external" links, due to us making the error of mixing an ASP.net site that requires postback with JQuery mobile, but that's another story...
I've seen this happen when the content is Safari "Reader" compatible (when you see the "Reader" label next to the url on the url bar). I'm not sure but if this is the case maybe you could try to make your content less Reader compatible.

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.

Resources