pcdoggy / mobiscroll

Automatically exported from code.google.com/p/mobiscroll
0 stars 0 forks source link

Mobiscroll not working after navigating from another page with jQuery Mobile #55

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
I discovered that if you navigate via <a> or <form> to a page with Mobiscroll 
and both pages (source/destination) are using jQuery Mobile AND both pages are 
on the same domain 

What is the expected output? What do you see instead?
The clicking on a field with the scroller will not launch the scroller unless 
you reload the destination page.

What version of the product are you using? On what operating system?
mobiscroll-1.5.2.js
Safari on iOS and FF on WinXP

Please provide any additional information below.
My work around was to use the target="_self" attribute on the form or link.  I 
did this in hope that it would equate to a page reload.  Perhaps it does.

Original issue reported on code.google.com by craigsw...@gmail.com on 30 Nov 2011 at 3:47

GoogleCodeExporter commented 8 years ago
That is being a problem for some of my projects too. Is it easy to solve 
withouth the _self workaround?

Original comment by DarkJ...@gmail.com on 3 Jan 2012 at 11:52

GoogleCodeExporter commented 8 years ago
I posted the original report in ingnorance.  It's actually the way jQuery 
Mobile is meant to work.  Default page requests are by Ajax unless overridden.  
It's all explained here: 
http://jquerymobile.com/demos/1.0/docs/pages/page-links.html

Original comment by craigsw...@gmail.com on 3 Jan 2012 at 12:31

GoogleCodeExporter commented 8 years ago
The only issue with adding the target is now you loose the loading and page 
transition.  Any other way around this?

Original comment by jakehuls...@gmail.com on 6 Jan 2012 at 8:58

GoogleCodeExporter commented 8 years ago

Original comment by diosla...@gmail.com on 27 Feb 2012 at 7:50

GoogleCodeExporter commented 8 years ago
Instead of the jquery document ready event, use the jqm pageinit event:

$('#page1').live('pageinit', function(event){
  $('#test1').scroller();
});

$('#page2').live('pageinit', function(event){
  $('#test2').scroller();
});

Put the code in a js file, which is included in both pages.
Form more details:
http://jquerymobile.com/demos/1.0.1/docs/api/events.html

Original comment by diosla...@gmail.com on 27 Feb 2012 at 10:33