Hi,
Currently implementing some scrolling Javascript (jQuery) on buttons to get them to smoothly scroll down to the section of the form. Works great when it's submitted, but when it i sand passed to the next step as a user task it ends up breaking. Anyone know if theres a workaround ?
The line that breaks is " if ($id.length === 0) {" it seems to find the element fine on click and can assign the variables but it can't return the value.
$(document).on('click', 'a[href^="#"]', function(e) {
// target element id
var id = $(this).attr('href');
// target element
var $id = $(id);
if ($id.length === 0) {
// if (!id[0]){
return;
}
// prevent standard hash navigation (avoid blinking in IE)
e.preventDefault();
// top position relative to the document
var pos = $id.offset().top;
// animated top scrolling
$('body, html').animate({scrollTop: pos});
//document click end
});