tuupola/jquery_lazyload — Issue #30: JavaScript not executed after clicking back button on IOS5
Author: tuupola
Created: 2012-03-08 15:47:23+00:00
State: open

Not directly related to Lazy Load. On IOS5 mobile Safari JavaScript is not executed when user clicks back button. Thus when user navigates away from page and comes back using back button images which have not been loaded yet will not be loaded even after scrolling.

Dirty workaround is to call ```window.onpopstate``` handler twice. First call happens on initial pageload. It will bind the second call to make all images appear. Second call happens when user clicks back button.

```
window.onpopstate = function() {
window.onpopstate = function() {
$("img.lazy").trigger("appear");
};
};
```

This is not optimal but works until real solution can be found.