Jquery Function Scroll To

I have a JQuery function that closes a <div>
$(document).ready(function() {	
	$('input[type="button"]').click(function() {
		if ($(this).attr("value") == "custom-done") {
			$("#custom-hidden").hide('slow');
		}
	});

HTML:::
<input id="edd-purchase-button" class="edd-submit gray button" type="button" value="custom-done" name="done-customizing">

Open in new window

Currently when I click the button, it scrolls to the bottom of the page.  I want to scroll to the top of the page when I click the button.

Any suggestions?
LVL 7
rgranlundAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
GaryConnect With a Mentor Commented:
For a quick scroll use
          window.scrollTo(0,0)

else using jquery to animate it
           $("html,body").animate({ scrollTop: 0 }, "slow");
0
All Courses

From novice to tech pro — start learning today.