Hi there,
I am creating a page on my wix site that displays an overview of the product that I carry. However, I would like to set up a on-site dropdown navigation that allows the page to automatically scroll down to the relevant section using anchor elements.
export function dropdown1_change(event, $w) {
let dropdownSelIndex = $w(“#dropdown1”).selectedIndex;
console.log(dropdownSelIndex);
if (dropdownSelIndex === “0”){
$w(“#orthoAnchor”).scrollTo();
return ;
}
if (dropdownSelIndex === “1”){
$w(“#gastroAnchor”).scrollTo();
return ;
}
}
The dropdown menu has id of dropdown1, the onChange() function also has function name of dropdown1_change. The anchor element ids are orthoAnchor and gastroAnchor respectively.
Here is the code I have written with reference to another user on this site, it does not seem to work. Could anybody kindly point out why this is so? I am a beginner with javascript and also with wix web design so I am very confused. Thank you for your help!