-
Notifications
You must be signed in to change notification settings - Fork 506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Confirm and scrollTop in action causes page to scroll up and then back down #468
Comments
Hi, I haved same problem, i solved it with :
|
HMM, that's not working for me either, here's the new code I am using:
|
Did you try with bigger wait time ?
Le mardi 19 mars 2019, 19:11:51 CET dcdalton a écrit :
… HMM, that's not working for me either, here's the new code I am using:
```
okay: {
text: 'Okay',
btnClass: 'alert_button',
action: function() {
setTimeout(function() {
$('html').stop().animate({
scrollTop: $('#voters_guide_form').offset().top
}, 500);
}, 100);
}
```
}
|
BINGO! I set the timeout to 600 and it now works perfectly ..THANKS! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jquery-confirm version:
v3.3.0
I'm submitting a ... (check one with "x")
[ ] bug report
[ ] feature request
[x] support request
Current behavior:
Using the jQuery confirm to tell user there are issues within the submitted form, in the action on the button I have a scrollTop. When the button is clicked the page scrolls to the top and then back down to the bottom.
Expected behavior:
Expect page to scroll top and stay there, here is my code:
I should also note without using jQuery-confirm the behavior is correct. I have also played with using different element ids in the scrollTop and even added the .stop() before the animate call. Nothing changes
The text was updated successfully, but these errors were encountered: