jQuery scrollTop not triggering
Hello, all,
I've got some code that seems legit (to my eyes) but isn't working as expected. I could use a fresh set of eyes on this.
What I'm doing is using AJaX to submit form data in the background, and I am returning either form validation alerts or a success message in plain text. Upon receiving the response, I am adding the message to a div at the bottom of a modal (did I mention the form is in a dialog?), and wish to have the form scroll to the bottom of the dialog so the user will notice the message. The message is successfully appearing in the div inside the form, but I can't get the form to scroll down.
What I have, so far, is this (truncated for brevity):
$.ajax({
...
}).done(function(data){
var frx = $('#formResults');
frx.html(data);
frx.scrollTop(frx.prop("scrollHeight"));
});
Any thoughts regarding this non-responsive or non-triggered scroll?
V/r,
^ _ ^
