Why is my jquery animate() function not working?
<p><div class="snippet" data-lang="js" data-hide="true">
<div class="snippet-code snippet-currently-hidden">
<pre class="snippet-code-js lang-js prettyprint-override"><code>$(document).ready(function() {
 
 $(window).scroll(function() {
  //alert("Window scroll event detected.");
      
  if ($(".image-container").visible(true)) {
   //alert("if ($(\".image-container\").visible(true))");
   $(".image-container").animate({background-position:center 100%}, 300);
  }
      
 });
 
});</code></pre>
<pre class="snippet-code-css lang-css prettyprint-override"><code>body {
 margin:0;
}

.p-wrapper {
 height:130vh;
 background-color:wheat;
 color:coral;
 overflow:hidden;
}

.image-container {
 height:200px;
 background-image:url(http://www.galleonnews.com/wp-content/uploads/2015/02/creative-mind-brain-wallpaper-870x489.jpg);
 background-size:100% auto;
 background-position:center 0%;
 color:transparent;
}

.another-p-wrapper {
 background-color:pink;
 color:green;
 overflow:hidden;
}</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
&lt;script src="http://cdn.jsdelivr.net/jquery.visible/1.1.0/jquery.visible.min.js"&gt;&lt;/script&gt;


&lt;div class="p-wrapper"&gt;&lt;p&gt;I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.I am a paragraph.&lt;/p&gt;&lt;/div&gt;
 
 &lt;div class="image-container"&gt;.&lt;/div&gt;
 
 
 &lt;div class="another-p-wrapper"&gt;&lt;p&gt;I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. I am a another paragraph. &lt;/p&gt;&lt;/div&gt;</code></pre>
</div>
</div>
</p>

<p>OR</p>

<p><strong><a href="https://jsfiddle.net/sfwjk31f/" rel="nofollow">JSFiddle here.</a></strong></p>

<p>In this SSCCE, if you uncheck the second comment, and reload it, you can see that the jQuery plugin is working correctly, i.e. ASA any part of the <code>.image-container</code> becomes visible, <code>if ($(".image-container").visible(true))</code> returns <code>true</code></p>

<p><strong>So the problem lies with the statement: <code>$(".image-container").animate({background-position:center 100%}, 300);</code>. This isn't doing anything. The question is why?</strong></p>

<p>The effect I want is that as the window is scrolling down, the background image of should animate its <code>background-position</code> from <code>center 0%</code> to <code>center 100%</code>. So that the user can see the bigger image set as background of a smaller div (heightwise), while they are scrolling the window.</p>