0)..."> 0)...">
The Big Spring Sale! Up to 50% off!

Javascript -Adding JS on Header

mrjohnjosol
1 Posts
mrjohnjosol posted this 19 April 2023
Ask a Question

I like to add this script:

const header = document.querySelector(".header");
window.addEventListener("scroll", function () {
if (window.scrollY > 0) {

header.classList.add("header-transparent");

} else {

header.classList.remove("header-transparent");

}
});

But I dont know how to insert javascript in nicepage desktop application

I like to add this script: const header = document.querySelector(".header"); window.addEventListener("scroll", function () { if (window.scrollY > 0) { header.classList.add("header-transparent"); } else { header.classList.remove("header-transparent"); } }); But I dont know how to insert javascript in nicepage desktop application
Vote to pay developers attention to this features or issue.
1 Reply
Order By: Standard | Newest
Support Team
Support Team posted this 20 April 2023

Hi,

Thanks for contacting us

The code can be added in Nicepage under the Site Settings or Page Settings >> HTML >> Additional HEAD HTML field
Don't forget to wrap the script with

Also, check our documentation below
https://nicepage.com/doc/29438/run-custom-jquery
...................................................
Sincerely,
Ahmad.
Nicepage Support Team

Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp

Hi, Thanks for contacting us The code can be added in Nicepage under the ***Site Settings or Page Settings >> HTML >> Additional HEAD HTML*** field Don't forget to wrap the script with <script></script> Also, check our documentation below https://nicepage.com/doc/29438/run-custom-jquery ................................................... Sincerely, Ahmad. Nicepage Support Team Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1 Follow us on Facebook: http://facebook.com/nicepageapp
You must log in or register to leave comments