Return to top function

Thank you. I did find that code, I guess I am just a little confused on how to format it into the drop-down. So like when a certain option is selected it would scroll to top. Attached is my code from the drop-down as is, could you maybe help me figure out how to add that?

let fadeoutOption = {
“duration” : 2000,
“delay” : 0,
}
let fadeinOption = {
“duration” : 1500,
“delay” : 0,
}

export function dropdown1_change(event) {
if ($w(‘#dropdown1’).value === ‘All’){
$w(‘#galleryRFS’).hide(“fade”, fadeoutOption);
$w(‘#galleryCommunity’).hide(“fade”, fadeoutOption);
$w(‘#galleryRetail’).hide(“fade”, fadeoutOption);
$w(‘#galleryEA’).hide(“fade”, fadeoutOption);
$w(‘#galleryAll’).show(“fade”, fadeinOption);

} 

if ($w(‘#dropdown1’).value === ‘RFS’){
$w(‘#galleryAll’).hide(“fade”, fadeoutOption);
$w(‘#galleryCommunity’).hide(“fade”, fadeoutOption);
$w(‘#galleryRetail’).hide(“fade”, fadeoutOption);
$w(‘#galleryEA’).hide(“fade”, fadeoutOption);
$w(‘#galleryRFS’).show(“fade”, fadeinOption);
}
if ($w(‘#dropdown1’).value === ‘Retail’){
$w(‘#galleryAll’).hide(“fade”, fadeoutOption);
$w(‘#galleryCommunity’).hide(“fade”, fadeoutOption);
$w(‘#galleryRFS’).hide(“fade”, fadeoutOption);
$w(‘#galleryEA’).hide(“fade”, fadeoutOption);
$w(‘#galleryRetail’).show(“fade”, fadeinOption);
}
if ($w(‘#dropdown1’).value === ‘EA’){
$w(‘#galleryAll’).hide(“fade”, fadeoutOption);
$w(‘#galleryCommunity’).hide(“fade”, fadeoutOption);
$w(‘#galleryRetail’).hide(“fade”, fadeoutOption);
$w(‘#galleryRFS’).hide(“fade”, fadeoutOption);
$w(‘#galleryEA’).show(“fade”, fadeinOption);

} 

if ($w(‘#dropdown1’).value === ‘Community’){
$w(‘#galleryAll’).hide(“fade”, fadeoutOption);
$w(‘#galleryRetail’).hide(“fade”, fadeoutOption);
$w(‘#galleryRFS’).hide(“fade”, fadeoutOption);
$w(‘#galleryEA’).hide(“fade”, fadeoutOption);
$w(‘#galleryCommunity’).show(“fade”, fadeinOption);
}

}