javascript - Scrolling webpage using jquery onclick to a div -


i have form on html , submitting form using below code

<div class="submit-clear"> <input  id="generate" type="submit"  name="script" value="create"/> </div> 

the form data displayed on separate div @ bottom of hash tag page #output

output section div id is

<div id="output-main">  <-------output of form data displayed here---->  </div> 

once user submit form, need scroll webpage <div id="output-main"> section display output. after searching previous question, got below solution, not working me.please me here

$('#generate').click(function() {     $.scrollto($('#output-main'), 500); }); 

edit:

i have scroll webpage after form submit.the webpage refresh data after formsubmit , load #ouput page form output

have correctly included scrollto library? sure not getting js error elsewhere (this may break code)?

here working demo: http://jsfiddle.net/8cy7v/

$("#generate").click(function() {     $.scrollto( '#output-main', 800); }); 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

php - MySQLi multi_query results for later use -