Having trouble getting the jQuery scroll to function properly in the following code snippet.
Essentially, I want to display a button named #checking
when the class k.state-disabled
is not active.
After the button is displayed for the first time, I aim to scroll to the top of the #step1
div.
The button display part is functioning correctly, but the scrolling aspect is not working as expected...
$(document).ready(function(){
if($(".k-state-disabled").length === 0) {
$( "#checking" ).show();
$('html,body').animate({
scrollTop: $("#step1").offset().top
});
}
});