jquery - Jump to ID after ajax form submit -


i have following form. after search form submitted , results returned via ajax call, page jump id - happens top of results.

<form class="avail-form">   ...    <input type="submit" value="search" /> </form>  <div id="results">results found</div> . . results . 

current attempt doesn't work.

$(document).ready(function() {     $('form.avail-form').click(function() {         $(this).scrolltop($('#results').offset().top);     }); }); 

i tried using submit instead of click no luck. tried bunch of different apporaches can't seem right.

just change hash when request completes.

$.ajax({     url: ...,     success: function(){         window.location.hash = "#results";     } }); 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -