Hi it looks like you are missing a curly braces. I think it should be like this:
$w.onReady(function () {
// Write your code here
$w(" #headertransition “).onViewportLeave(() => {
$w(” #scrollingheader “).show();
$w(” #defaultheader “).hide();
})
$w(” #headertransition “).onViewportEnter(() => {
$w(” #defaultheader “).show();
$w(” #scrollingheader “).hide();
})
if(wixWindow.formFactor === “Mobile”){
$w(” #scrollingheader ").hide();
} // ← here
})