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
Post a Comment