Jump to content

Insert my own Java Script in cms pages!


ricardoflores

Recommended Posts

Hello,

Hello how I can I insert my own java script code into cms pages of my template in prestashop?

I Have this page in my shop: https://the-skin-clinic.co.uk/content/6-contouring-facial-serum .
I want to insert this code:

 

-----------------------------------------------------------------------------------------------------

window.onscroll = function () {
myFunction()
};

    function myFunction() {
        if (document.body.scrollTop > 270 || document.documentElement.scrollTop > 270) {
            document.getElementById("myContent").className = "AnimationTopFadeOut";
        }
        if (document.body.scrollTop > 670 || document.documentElement.scrollTop > 670) {
            document.getElementById("myContent2").className = "AnimationTopFadeOut";
        }
        if (document.body.scrollTop > 1070 || document.documentElement.scrollTop > 1070) {
            document.getElementById("myContent3").className = "AnimationTopFadeOut";
        }
    }

-----------------------------------------------------------------------------------------------------

This code that I made is to add an animation when scrolling the text apears.

How can I do that?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...