Scroll to the top of the lightbox programmatically
<p>The scenario is that I have a light box that displays a set of image thumbnails and the user is able to delete those images. Once the user deletes an image I set the <code>text</code> of a label that is on top of the light box. </p>

<p>The issue I'm facing is that since there are many images, once the user deletes an image which is located in the lower part of the light box, the user doesn't see the success message I'm setting. </p>

<p>What I want is to scroll to the top of the lightbox where the users can see the success message. </p>

<p>I tried scrolling to the div by using </p>

<pre><code>$(window).scrollTop($('#messages').offset().top);
</code></pre>

<p>But the problem I'm facing is that it doesn't scroll to the top of the lightbox. Instead it scrolls to a position of the page underneath. I guess it's getting scrolled to the initial place where the <code>div</code> was at on page load. </p>

<p>If anyone can shed some light on how to fix this issue it would be really great. Thanks in advance.    </p>
