I am trying to make a sticky header, and I followed the Wix tutorial on YouTube. For some reason, I keep getting an error saying that I don’t have a valid selector. I have double, triple, and quadruple checked, and it won’t work. In fact, it won’t let me select any element on my page. I have tried deleting everything and starting again and I still get the same error. Please help
If this is on your site code tab, then have you simply just tried testing it to see if it works in preview or live site?
If you copy it into the page code tab the errors will probably be gone.
If you still have errors when it is in your page code tab, then it will be an error with your code.
There is an ongoing issue with the site code tab that it shows errors which are not errors, however the code works fine when tested in preview mode or on a live site.
Unfortunatley, that hasn’t worked.
Please post the editor URL of your site. Only authorized Wix personnel can get access to your site in the editor. Please include the name of the page involved.
Hi Destiny, Did you get anywhere with your enquiry? I have the same issue I get error markings on both the $w(“#headerSwitchPoint”) entries
$w.onReady ( function () {
$w( “#headerSwitchPoint” ).onViewportLeave(() => {
$w( “#smallheader” ).show();
$w( “#largeheader” ).hide();
})
$w( “#headerSwitchPoint” ).onViewportEnter(() => {
$w( “#largeheader” ).show();
$w( “#smallheader” ).hide();
})
});