title: Internet Explore 8 won't change image src with .attr()
body: <p>I have set up a page which will flick through a sequence of images as the user scrolls with their mouse or trackpad. I'm using jQuery to measure the distance from the top of the page - scrollTop() - to then change the image source for a particular id in the DOM.</p>
  
  <p>This is working perfectly in Firefox, Chrome, Safari, Opera, IE9 and also on the iPad, iPhone, etc. HOWEVER, it doesn't work in IE8.</p>
  
  <p>This is the HTML:</p>
  
  <pre><code>&lt;div id="flipping-container"&gt;
      &lt;img id="flipping-id" class="flippingTarget" src="imageOne.png" alt="imageone" /&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>This is the JS:</p>
  
  <pre><code>$(document).scroll(function() {
      var toTop = $(document).scrollTop();
      if (toTop &lt;= 340) {
              $('.flippingTarget').attr('src','imageOne.png');
      }
      else if ((toTop &lt;= 392) &amp;&amp; (toTop &gt; 341)){
              $('.flippingTarget').attr('src','imageTwo.png');
      }
      else if ((toTop &lt;= 445) &amp;&amp; (toTop &gt;= 393)){
              $('.flippingTarget').attr('src','imageThree.png');
      }
  
  // AND SO ON
  // ENDING WITH...
  
      else {
              $('.flipping-target').attr('src','image1.png');
      };
  });
  </code></pre>
  
  <p>The div ID of "flipping-container" is given a CSS value of position:fixed; so it is always visible.</p>
  
  <p>I have poured through StackOverflow posts and not managed to find a working solution as yet. The scrollTop() value is being read perfectly fine as I have click events on buttons which will smoothly scroll the page to a div and/or a number of pixels from top. IE8 is fine with this, so it's not the html/body/document/window scrollTop() issue.</p>
  
  <p>I have switched out the .attr() value for .addClass() to see if that will be picked up. But it doesn't in IE8. So it may not be directly related to the src attribute itself. I've double checked my class names and targets and they're all fine (also proven by the other browsers perform as intended).</p>
  
  <p>Any clues? Any help would be much appreciated.</p>