window.scroll and scrollTo not working on iOS - javascript

I have a simple javascript that works perfectly on Mac and PC platforms, but stubbornly refuse to scroll on any iOS device.
function scrollWin(ctx) {window.scroll((XSobject Map_zoom_x) - Xwindow/2, (YSobject * Map_zoom_y) - Ywindow/2);}
Does anyone have any ideas how I can get this function to work on iOS devices? The rest of the scripting plots a map and this final step should scroll the window to the location on the map, so it is pretty essential. However, any iOS device ignores it and shows the map at the origin.
I have tried embedding it in a setTimeout but that doesn't help either. window.scroll does the same thing.
Many thanks for any pointers for this. Anatole

Related

Google Embeded maps won't work with infra-red touch frame

I'm trying to use Google Maps (JS APIv3) in Chrome, in a kiosk mode, intending to use it with and infra-red touch frame. IR touch frame in a HID-mode (emulating not a mouse, but rather a touch device) works perfectly with maps.google.com, allowing to pan map with a finger, but won't allow it on an embedded map.
I assume that Google uses some sort of additional library for touch events, but looking into source code haven't given me any hints.
Anyway, is it possible to enable panning in an embedded google map for a generic touch device?
Thanks in advance!
Well.. even they have document on this control option, they don't seems to provided ways to enable the touch to pan event....
One work around might be to set to user-agent as chrome on Android.

Phonegap scrolling issues on android 5

We are developing an app using Phonegap/Javascript.
Scrolling used to work fine, until we tried the new Android 5.
The page does not scroll down, unless you swipe many times. Then it is stuck in the other position..
Can't find anyone with this problem!
We are using just simple divs with content that is taller than the screen. Works fine on Android <5 or iOS.
Any ideas?
This is what finally solved the problem, along with simplifying properties, etc.:
Hammer.defaults.stop_browser_behavior.touchAction = 'pan-y';
It was an issue with the hammer.js plugin with touchAction property.
This affects some browsers - and apparently also Android 5 (but doesn't affect Android 4.* when using PhoneGap).
Not as simple as it seems, more details here:
https://github.com/hammerjs/hammer.js/wiki/How-to-fix-Chrome-35--and-IE10--scrolling-(touch-action)

kineticJS sprite animation malfunction in iPad and android browser

I’m having a problem with the use of sprite sheets in mobile browsers (ipad/android), a strange behavior occurs, the stage is multiplied and scaled down multiple times when i click on a sprite animation, everything works fine until the click occurs.
Any hint?
The only browser that it doesn’t occurs is the safari from the ios 6 beta in ipad 2. In the native android browser the error happens but in android chrome everything works fine.
In desktop browsers everything works fine.
UPDATE: the problem is the afterFrame, the error is that the index is not valid. I don't understand... what does the afterFrame? i have 7 frames and it gives error if the after frame is superior to 2...
What version are you using? This sounds like a bug that has been fixed in v4.0.1.
https://github.com/ericdrowell/KineticJS/wiki/Change-Log

iPad canvas very bad to zero performance

The javascript library I have created just translates a single picture and zooms it. Touch events and mouse events are used depending on what device.
I ran this javascript code on Firefox (7.0.1), iPhone 3GS (iOS 5.0) and iPhone 4 (iOS 5.0) all with smooth performance, no problem at all.
Then I ran it on iPad 1 (iOS 5.0) with slow performance though zooming and translating the picture works.
Last test was on iPad 2 (iOS 4.3.3) and here I experienced the same slow performance while zooming as iPad 1 but the translating didnt work at all.
I have no clue what this is about, since iPhone is supposed to be alot weaker than an iPad. I would appreciate any help or comments to get me on the right track.
http://pastebin.com/wZ7e77yq
UPDATE
I just ran it on an iPad 2 (iOS 5.0) and it works flawlessly. I also tried iPhone 3GS (iOS 4.2.1) and it didnt work, same as iOS 4.3.3. This means that my application needs iOS 5.0 to run... is it really true you couldnt translate objects before iOS 5.0?
UPDATE2
I just ran it on three different iPad 1s (iOS 5.0) and it doesnt work very good. What is the big difference in between an iPhone 4 and an iPad 1? Specs are almost identical. Also the translate didnt work because the function event.pageY/X doesnt work prior to iOS 5. This was fixed by using event.touches.pageX/Y instead.
Well I was developing a small game for testing canvas performance without any special game framework so I kept it simple because I was writing it by myself. The program did nothing special, just moving a sprite around the screen with different joystick types, such as keyboard and mouse for desktop click, and touch events for iOS. I discovered the following:
Using taps direct on the canvas results in poor performance compared to touch events.
Touch events worked well with different canvas sizes up to 1024x768.
I didn't try picture zooming, but that should have be fine as well.
event.pageX, event.pageY worked without problems on iPad (iOS5).
I hope that helps.
Seems like perhaps iOS CANVAS support was the issue. iOS5 has full GPU hardware-accelerated CANVAS support, while previous versions supported CANVAS albeit very poorly.
Surprised that it does not work well on iPad 1 even with iOS 5, though. Can you try closing all currently-running apps, close all other browser tabs, and run the test again?

Google Chrome background jittering when moving pictures

I was working on an image gallery and it involved some heavy image moving\resizing using javascript. Everything worked like a charm on all the broswers except for IE6\7 (no wonder) and ... Google Chrome.
Basically under certain zooming each movement made Chrome redraw the background, making it jitter, change its position and then move back. I can't post link to the actual script at the moment, but I used a jquery plugin to immitate the problem:
http://danilsk.narod.ru/wtf.html (try zooming in and out and clicking images)
Does anyone know how to fight this?
I am using google chrome and I see no issue here.
Everything is running very smoothly. Try updating your browser.
FYI:
Ubuntu 10.04 LTS - the Lucid Lynx
Google Chrome 8.0.552.215

Categories

Resources