jQuery mobile page repositioning

jQuery mobile page repositioning

Hi,
I want to ask about the jquery mobile...
Actually I'm making a jquery mobile site and I used pannels in pages, I want that a user when click on Menu button so panel should open and panel & page should reposition to the top. So I don't know how to write jqurey, If anyone can write me a code for this function that'll be very much helpfull. I tried a code to reposition the page but when it reposition the page then panel doesn't open....

Thanks a lot...

Here is the code...


<script>
$(document).ready(function(){

        // scroll body to 0px on click
        $('#mainMenuButton').click(function () {
            $('body,html').animate({
                scrollTop: 0
            }, 800);
            return false;
        });
    });
   
   

</script>