Good Evening,
i am having a problem with android 4.1 when it comes to scrolling and swiping. (I am using jquery mobile)
I have a list which you can delete items from by simply swiping to the right. When it comes to iOS, everything is really crisp. But it seems that android cant handle scrolling and swiping on the same element. You can only scroll in a 90° angle, but changing it to ~85° messes up the scrolling.
When i remove the swiping event, everything works fine. Is there a known fix for that?
Regards Dominik
$.event.special.swipe.scrollSupressionThreshold is the answer to that problem.
JqueryMobiel supresses scrolling when there is a swipe event on an item. Simply modify the values above to your liking and you'll be fine!
$.event.special.swipe.scrollSupressionThreshold = "30px";
30px is not the right parameter, it is 30 (without px), but 30px solves my problem.
Related
I am writing an application where I need to scroll in both (left and right direction) infinitely.
I checked with following link and it work great but only in right side.
Is there any way to achieve left side scrolling as well.
Any suggestion here?
You can have a look at this project, I used it and it worked quite good, but in my case I had to do some other work to make things working in a correct way.
I have an issue on my phone running Android 4.0.4.
I have an iframe with a text field and a couple of dropdowns, but the iframe is too wide to fit in the phone window when in portrait mode, so I get a horizontal scroll bar so I can scroll to see all of the fields.
The problem is, if I scroll the iframe to the right I can no longer select the text box or the dropdowns.
It looks like the device doesn't realise the iframe has been scrolled to the right, so for example, when the iframe first renders, the content is positioned left aligned. At this moment, one of the dropdowns is visible at the far right of the iframe. If I scroll the iframe all the way to the right and tap the screen where the dropdown used to be, I get the selection screen for the drop down even though the area of the screen I actually clicked had no element on it at all.
If I tap the screen where the dropdown actually is, I get no response at all.
I have a test page here:
http://snow.x10.mx/damian/page.html
Everything works fine on Firefox on the desktop, so it looks like it may be just an Android bug.
Can anybody suggest a workaround for it (other than making sure the iframe isn't wider than the screen) because I can't see an Android fix coming any time soon!
If anyone has an iPhone they can test it with, can you let me know if you have the same problem?
I've run into the same issue with Android 4.0.4
The same thing happens with vertical scrolling, and applies to input fields, links... Anything that should react to a touch/click event. If the element is visible before scrolling the position where it was is still reacting to the touch event after scrolling. And if it's not visible before scrolling there is nothing you can do to interact with that element.
I'm not sure what's causing this, but using a scrollbar plugin ( jScrollPane ) has solved it for me.
Good luck!
I know there are already a bzillion threads about this, but I cannot get a solution.
Problem: Not every swipe gesture is recognized.
Setup: Android 4.0.4, PhoneGap 2.1 and jQuery Mobile 1.2
On a touchMove (scroll or swipe) I get (almost every time)
Miss a drag as we are waiting for WebCore's response for touch down.
The problem seems to be that my setup is not able to detect a touchstop properly.
I using the following at the moment for swiping:
(".mainList").swipeleft(function() {
$.mobile.changePage("status.html", {
transition : "slide"
});
console.log("swipe left!!!");
});
and this for enabling the swipe to be triggered correctly every time:
// deactivate normal touch handling for swipe to work
document.ontouchmove = function(event) {
event.preventDefault();
};
This way swiping works every time but scrolling (of course) does not work anymore. You could apply this function only for the header of a page to make the header "swipable" and the content scrollable but not swipeable correctly. But this cannot be the real solution.
I tried the following tips I gathered from various thread:
use the ".on" function to bind the swipe event
bind the swipe event to a class rather than an id
Try to detect a horizontal scroll by using "ontouchstart" and "ontouchend"
This does not work as the touchend event is not triggered on every swipe.
experiment with different values of the swipe constants like $.event.special.swipe.scrollSupressionThreshold
As I thought maybe the setup is not show whether a swipe is a real swipe or a horizontal scroll:
prevent horizontal scrolling via css overflow
prevent horizontal scrolling by using a customized cordovarwebview
use different values fo the viewport meta tag in my html to set the correct page width
All trials except the event.preventDefault(); approach do not change the situation: only every second, third or fourth swipe gesture is recognized correctly.
Anyone with the same problem and maybe a solution? :D
Thx in advance
Am I just going crazy, or does background-attachment:fixed; really not work in the native Android browser?
I already implemented a simple fix by using two divs instead of one... The first div is positioned absolutely and contains the fixed background image, the other div goes on top of it and contains the scrolling content.
The issue with this fix (aside from the unnecessary complication) is that for some reason, when I am scrolling the content over the background image div, the background image disappears altogether! :(
Has anyone else found a workaround that isn't buggy, or how exactly are we supposed to work with this?
With native browser scrolling you cannot do that. It's a bug in the default Andriod browser. To implement a fixed element at the top or the bottom you have to apply position: fixed on it and then implement a custom scrolling on the other element which contains the content to scroll.
I used this Library for this kind of problems:
http://cubiq.org/iscroll-4
You can find examples on its page.
The problem appears in Android 2.2. It seems cool because it can auto-hide.But I don't like it quite much because the bar is an indicator for "Whether there is more content not present on the widget". Hiding it maybe neat, but may get the users wrong sometimes. In ListView, I find it a fatal bug at all. When there is more content to show, no scrollbar present, AND when wipe the screen down-wards, no scroolbar appears. Only when use the traceball or Dpad to move focus, there appears the scrollbar. BUT THERE IS WORSE: when you wipe down-wards to move the scrollbar down, nothing happens! The touch feature is almost disabled here.
Can anyone help me here? Thanks!
Maybe answers there will help you
Android ListView that does not scroll?
I had a listview inside of a scrollview. After I'd commented scrollview it was possible to use listview's scrolling.
The weird thing is, that this problem occurs only on Android 2.2.
I am using a listView in android 2.2 and it works just fine . The vertical scrolling happens implicitly without the inclusion of a scroll view . Hope your ListView id is #android:id/list.
And a small correction , to move down the list , you need to wipe the screen UPWARDS not DOWNWARDS ....