Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Workaround for IOS5 back / forward cache problem. Forces images to lo…

…ad when back button clicked.
  • Loading branch information...
commit 6ca5fafe22f6e991c4a8b0d59fe9328d74963d66 1 parent 4efe91d
@tuupola authored
Showing with 13 additions and 1 deletion.
  1. +13 −1 jquery.lazyload.js
View
14 jquery.lazyload.js
@@ -9,7 +9,7 @@
* Project home:
* http://www.appelsiini.net/projects/lazyload
*
- * Version: 1.8.1
+ * Version: 1.8.2-dev
*
*/
(function($, window) {
@@ -131,6 +131,18 @@
$window.bind("resize", function(event) {
update();
});
+
+ /* With IOS5 force loading images when navigating with back button. */
+ /* Non optimal workaround. */
+ if ((/iphone|ipod|ipad.*os 5/gi).test(navigator.appVersion)) {
+ $window.bind("pageshow", function(event) {
+ if (event.originalEvent.persisted) {
+ elements.each(function() {
+ $(this).trigger("appear");
+ });
+ }
+ });
+ }
/* Force initial check if images should appear. */
$(document).ready(function() {
Please sign in to comment.
Something went wrong with that request. Please try again.