How to make a JQueryMobile-based application have a "touch" behavior in a desktop browser - jquery-mobile

I am using JQueryMobile to build an application that will mainly run on a Linux-based touch device with Firefox.
My issue is that, with JQM, when page contents cannot fit on the screen, the web browser displays a vertical scrollbar displays a vertical scrollbar
There is no such issue with Sencha and Dojo. They both behave like if they were running on a touch-based device, even with desktop web browser (reduce the height of your browser window) :
Sencha scrolling list
Dojo scrolling list
So, how can I make JQM to be touch-friendly when running on a desktop web browser ?

It seems that there is no really good JS and/or CSS solution for this issue.
Hiding the scrollbars with CSS (overflow-y: hidden;) prevents scrolling and mess JQM touch events.
I found a workaround by using a Firefox plugin (Grab and Drag), which is an acceptable solution since I control the device that runs the browser.
It works fine, but it is not a pure JS/HTML/CSS solution...

Related

Replacing an iframe with a Webview in an iOS Cordova Project

I am currently developing a hybrid app in iOS that loads a website and has some other features (contacts, sharing, notifications...) using cordova plugins. I do have access to the content of the site that is being displayed by the iframe.
The normal way this is done is to load the website in an iframe. I have already done this in android and it works very well. In iOS however:
Safari messes up the size of the frame. I fixed this by setting the min-width css style to 100% for the frame.
Scrolling on the iframe is always set to "no" even if you specify "yes. I "fixed" this (so I thought) by using the only solution I could find which is to wrap the iframe in a div and scroll the div. This made the header (position:fixed) scroll with the page when it should be fixed to the top of the page and broke other things on the page that rely on scroll position to trigger an action. I also tried modifying the body of the content to contain css styles mentioned here but this didn't work either. I was back to square one.
I have spent a total of a week researching how to fix this with no avail. Recently I have discovered that loading my website in iOS's UIWebView or WKWebView works well to display the site exactly how I would expect.
That brings me to two possible solutions (and my question):
Maybe I missed something with the css style on the content of the site. I read that it is possible to get scrolling to work this way but I am sceptical because safari does not allow scrolling on an iframe.
(The likely solution but the one I cannot figure out) Make my cordova app use a one of iOS's webviews. This is what I am having problems with. I cannot figure out how to do this. Is a webview an iframe? How do I use one of these webviews in my app? What does the index.html (cordova specific file) look like when I use a webview instead of an iframe (because currently this is where my iframe is).
I solved this. Since I have access to the contents of the page, I added:
position:absolute
top: 0
right:0
bottom:0
left: 0
overflow-y: auto
overflow-x: hidden
-webkit-overflow-scrolling: touch
To the scrolling body of the page. This fixed my problem

jqueryui sortable issue with Chrome and Firefox

I created a horizontally scrollable container with sorting.
There are some requirements:
The bounding box is fixed width
Must scroll when overflowing, no wrapping
Here is the JSFiddle: http://jsfiddle.net/6vXG2/ (drag columns with pink header)
This works perfectly with: IE9, Opera, Safari
But not working with: Chrome, Firefox
In both Chrome and Firefox, the elements start jumping around. (Incidentally, the behavior on Firefox is different between Windows and OSX, using exactly the same version - 17.0.1)
When initially designing it using float:left, all browsers behaved correctly, but due to no wrapping requirement, I cannot use this.
Any ideas how to fix this? Or is this a jqueryui bug/issue?
Thanks
EDIT:
If I add border-collapse: collapse it behaves correctly again in Chrome, but breaks in Opera.
EDIT 2:
Found a 'weak' workaround going back to float:left: See http://jsfiddle.net/6vXG2/1/. Not ideal, but OK for now. Still open for suggestions.

Is there any way to handle the flickering screen in jQuery mobile

I am using jQuery mobile 1.1.0 and I am facing a problem that when I run the application in the browser it works fine but when I run this through 'Home screen icon' it starts flickering the pages.
I am using iphone 5.1.
Does anybody have a solution for this issue?
You need to update to jQM 1.1.1, screen flickering issues have been fixed in this version. This problem affected running jQM in UIWebView container like PhoneGap, but I assume it's similar when you save it on the home screen.
Try updating and see if it'll fix your problem.
Announcing jQuery Mobile 1.1.1
It's because of the page transitions. If you disable them globally for the time being, you'll fix your problem. It sucks to lose the transitions, but the white "flash" is far worse.
Here's the docs on disabling page transitions: http://jquerymobile.com/test/docs/api/globalconfig.html

Jquery Mobile Navbar issue

I have created bottom fixed tabs using jquery mobile data-role="navbar" inside a JQ footer. The issue is it creates a div on runtime outside the page flow which is absolute, more than the height of the page content. This is getting created on runtime and appears only when the navbar code is written. Need some help on it.
First, are you viewing the website on a mobile device (and which mobile OS if so).
This issue has appeared in my experience, but only when using a standard web browser.

How to enable iframe scrollbar on iOS safari

I am trying to implement facebook's live stream plugin on my website. I see that there is a scrollbar on pc and mac browsers, but not on iphone or ipad safari. I think it is because iphone and ipad treat scrollbar differently since they are both touch based devices. So I expect to scroll iframe with two fingers, but it does not work either.
Here is sample page (used a different src url) http://para.qacode.com/test.php
How do I enable two finger scrolling or normal scrollbar on ios safari?
On iOS versions prior to 5, you can scroll iframes on iPad/iPhone using two fingers, but this is a bit of a hidden feature and most people don't know about it. I'm not sure why tow-finger scrolling isn't working for your iframe - perhaps there is some JavaScript intercepting the touch event?
On iOS 5 this has been fixed and scrolling works as expected for iframes with one finger.
If you need to scroll a sub-region of the page on iOS 4 and earlier, the best bet is to use a library such as iScroll that implements scrolling with JavaScript touch-event handling.
Apply these styles to the parent container:
-webkit-overflow-scrolling:touch;
overflow:auto;

Resources