You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 27, 2019. It is now read-only.
I have a div that I am using iScroll 4.1.9 on. When I add some images to the div, everything inside it flickers on the iPhone. I found that if I add width and height attributes to the images, the flickering doesn't happen, but that is not always a practical option. I haven't figured out what exactly within iScroll is triggering the bug. I am using an iPhone 4 with iOS 4.2.1. This is the code that I am using:
<!DOCTYPE html><html><head><title>iScroll flicker bug</title><!-- The following meta tag is not necessary to trigger the bug. --><metaname="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
</head><body><buttontype="button" id="test">Test</button><divid="scroller" style="width: 100%; height: 300px"><divid="innerDiv"></div></div><scriptsrc="http://cubiq.org/dropbox/iscroll4/src/iscroll.js"></script><!-- iScroll 4.1.9 --><script>window.addEventListener("load",function(){newiScroll("scroller");});varhtml="<p>This text will flicker after the images load.</p>";for(vari=1;i<=10;i++){html+="<img src='http://dummyimage.com/320x480/000/fff&text="+Math.floor(Math.random()*(1e9+1))+"'>";}document.getElementById("test").addEventListener("click",function(){document.getElementById("innerDiv").innerHTML=html;});</script></body></html>
The random numbers in the image URLs are to disable the phone's caching and slow down the loading so the behavior is more noticeable. You can also access it at http://jsfiddle.net/X7xdf/1/.
The text was updated successfully, but these errors were encountered:
Sorry about that, yes #scroller. It's not a bug in iScroll it's a browser bug. iScroll could probably do this hack automatically to solve it, but I don't know how widespread the problem is.
I have a div that I am using iScroll 4.1.9 on. When I add some images to the div, everything inside it flickers on the iPhone. I found that if I add width and height attributes to the images, the flickering doesn't happen, but that is not always a practical option. I haven't figured out what exactly within iScroll is triggering the bug. I am using an iPhone 4 with iOS 4.2.1. This is the code that I am using:
The random numbers in the image URLs are to disable the phone's caching and slow down the loading so the behavior is more noticeable. You can also access it at http://jsfiddle.net/X7xdf/1/.
The text was updated successfully, but these errors were encountered: