javascript - jQuery 1.8 in IE 11 does not fire image load event on page load -


i have .net application loads images dynamically. have loading gif shown until image loads. image shown.

the loading gif image size 16x11. images loaded resized 80px width.

this code works in ie8-10 (but not in ie11):

$(imagestoloadlist).each(function () {      var image = $(this);     var realsrc = image.attr('real-src');      var demandedimageindex = parseint(categoryid) + (scrollcount * 10) + index;      image.unbind();     image.bind('load', { imageindex: demandedimageindex }, imageloaded);     image.attr('src', realsrc);      index++; });  function imageloaded(event) {      //after image loaded  } 

in ie 11, image loads not resize 80px , stays16x11. resize correctly when event fired again. (app has slider, load event called every time slide changed).

any ideas on how fix this?

fyi, doesn't matter if image cached or not. thinking along lines of ie8 bug

seems works in ie 11 jquery 1.8.0/1.8.3 (now latest stable versions 1.11.3/2.1.4. click preview load full-size image — jsfiddle:

var $img = $('img');    $img.one('click', function() {      $img.one('load', function() {          this.width = 320;          this.height = 240;          console.log('image loaded');      });        this.src = $(this).data('large-src');  });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>    <img src="http://oi59.tinypic.com/nxtdsp.jpg"       data-large-src="http://oi57.tinypic.com/fegkeb.jpg"/>

if you'll provide working code snippet bug, maybe you.


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -