title: Bootstrap Modal - Lazy load images
body: <p>I'm trying to get the images inside a Bootstrap modal to lazy load. Right now, when the modal appears, the image does not load, so I thought using $(window).resize(); would fix that but it does not seem to be working. Any ideas?</p>
  
  <pre><code> &lt;li class="gift_item ease &lt;?php $cat=get_the_category(); echo $cat[0]-&gt;slug;?&gt;"&gt;
      &lt;a href="#" class="btn" data-toggle="modal" data-target="#&lt;?php echo $target;?&gt;"&gt;btn&lt;/a&gt;
      &lt;div class="thumb"&gt;
          &lt;img class="lazy" alt="&lt;?php the_title();?&gt;" src="&lt;?php echo site_url('/wp-content/fohl/holder.png');?&gt;" data-original="&lt;?php echo $image[0];?&gt;" /&gt;
          &lt;noscript&gt;&lt;img src="&lt;?php echo $image[0];?&gt;" alt="&lt;?php the_title();?&gt;"/&gt;&lt;/noscript&gt;
      &lt;/div&gt;
      &lt;p class="title"&gt;&lt;?php echo textLimit(get_the_title(),20);?&gt;&lt;/p&gt;
   &lt;/li&gt;
   &lt;div class="modal fade" id="&lt;?php echo $target;?&gt;" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true"&gt;
      &lt;div class="modal-dialog"&gt;
          &lt;div class="modal-content"&gt;
              &lt;div class="modal-header"&gt;
                  &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&amp;times;&lt;/button&gt;
                  &lt;h4 class="modal-title" id="myModalLabel"&gt;&lt;?php the_title()?&gt;&lt;/h4&gt;
              &lt;/div&gt;
              &lt;div class="modal-body"&gt;
                  &lt;div class="main-image"&gt;
                      &lt;?php $image=catch_that_image(); if($image):?&gt;
                          &lt;img class="lazy" alt="&lt;?php the_title();?&gt;" src="&lt;?php echo site_url('/wp-content/fohl/holder.png');?&gt;" data-original="&lt;?php echo $image;?&gt;" /&gt;
                          &lt;noscript&gt;&lt;img src="&lt;?php echo $image;?&gt;" alt="&lt;?php the_title();?&gt;"/&gt;&lt;/noscript&gt;
                      &lt;?php endif;?&gt;
                      &lt;script&gt;
                          $('#&lt;?php echo $target;?&gt;').on('show.bs.modal', function () {
                              $(window).resize();
                          })
                      &lt;/script&gt;
                  &lt;/div&gt;
  
                  &lt;div class="content"&gt;
                      &lt;?php echo $content;?&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
   &lt;/div&gt;
  </code></pre>