My question was not complete. The div is not hidden on his own. It's part of a container div, which is hidden. The inner div displays with his parent.
<div class="container hidden">
<div id="some_div">Content</div>
<div id="my_div">I wanted to scroll this one</div>
<div id="other_div">Content</div>
</div>
We use jQuery came up with a custom "onShow" event.
So now we can do this:
$('#my_div').bind('show', function() {
handle_scrollTopOffset();
});
When the show event is bound, it adds the class .onShow
to the div. And the jQuery.fn.show()
function has been overridden to trigger the 'show' event on the childs which have the .onShow
class.
Thanks everyone for their suggestions. I'm sorry I provided a uncomplete question. I'll give all the details next time.