• Resolved prvyzbor

    (@prvyzbor)


    Hi,

    I have a problem that while the JS and CSS I wrote in the plugin work well for the live website, when I try to edit it in Elementor, they seem to have no effect.

    What I am trying to do is in JS I am calculating view height for a section, then in the CSS I set it to a class which in Elementor I assign to specific sections.

    Is there some incompatibility issue between the plugins? Any help would be highly appreciated.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Diana Burduja

    (@diana_burduja)

    Hello,

    on my test website the CSS custom code works the same on the frontend, as well as when I try editing the same page with the Elementor plugin.

    For example, I tried changing the page’s title to red with the following CSS custom code:

    h1.entry-title {
      color: red;
    }

    and indeed the page’s title was red both on the live website, as well as when editing the page with Elementor.

    Would you also try the same example? Just to see if the issue you’re experiencing is related to your specific custom CSS/JS code or not.

    Are you using the free or the pro version of Elementor?

    Thread Starter prvyzbor

    (@prvyzbor)

    Hi,

    I am using the free version of Elementor. Tried your example, still no visible change in the edit mode.

    For better description, here are some screenshots and code that I am using:

    My JS:

    let vh = window.innerHeight * 0.01;
    document.documentElement.style.setProperty('--vh', <code>${vh}px</code>);
        
    if(window.innerWidth >= 767){
    	window.addEventListener('resize', () => {
    		let vh = window.innerHeight * 0.01;
    		document.documentElement.style.setProperty('--vh', <code>${vh}px</code>);
    	});
    }

    My CSS:

    .top-section{
    	height: 100vh;
    	height: calc(var(--vh, 1vh) * 100);
    }

    View in Elementor: https://tinyurl.com/2rvd7fr5
    Live view: https://tinyurl.com/5ccbmdvr

    Plugin Author Diana Burduja

    (@diana_burduja)

    Your JS code says that if the page’s width is larger as 767, then it should show the 100vh top section. Would you change the 767 value to 350 and check the page with Elementor?

    When editing with Elementor there is a panel on the left side of the page with all the elements and settings. The panel takes about 300px from the page. It could be that on your monitor, when the Elementor panel is open, the page is narrower than 767, therefore the 100vh top section isn’t shown.

    Clicking the “Hide Panel” icon on the panel will not help, as your code first checks the page’s width, then it adds the “resize” event listener. Firstly, clicking the “Hide Panel” icon doesn’t trigger a “resize” event. Secondly, the “resize” event listener is added only after checking for the page size.

    Thread Starter prvyzbor

    (@prvyzbor)

    Thanks for the tip. Tried it, no change.

    Plugin Author Diana Burduja

    (@diana_burduja)

    Could you give me a link to your website so I can have a look?

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘JS and CSS not affecting Elementor builder’ is closed to new replies.