How can I hide this custom slider while Elementor editing window is open?
At holistic-health.care, which is a WordPress site using twenty seventeen and Elementor, there is a slider on the front page built with Smart Slider 3. It's set to disappear on scroll using a bit of javascript, and that's working just fine.
I built the slider in this way on top of a site I didn't build myself because the client was using twenty seventeen and the top element of that particular theme doesn't lend itself to easily adding other elements with a page builder. I echo the shortcode from Smart Slider 3 in header.php
and everything seems to work fine.
The problem is that the JS that does the hiding of the slider on scroll doesn't work when the page is being edited in Elementor, and it prevents you from being able to activate any of the elements in the editor. It's a simple enough matter for me to hide it using CSS while editing, but this is not a real solution, and more importantly the people who own this site won't know how to do that.
I need this slider to go away completely when Elementor is active, but I can't figure out how to make it happen.
The div class is .n2-ss-slider
.
So far I've tried the following JS (in header.php
):
if (window.location.href.indexOf(action=elementor) != -1) {$(.n2-ss-slider).hide();
also
if (/action=elementor/.test(window.location.href)){document.getElementByClassName('n2-ss-slider').display = 'none';
and I'm at about the end of my repertoire. Can anyone offer another suggestion, using either CSS or JS or even PHP?
Topic theme-twenty-seventeen css Wordpress javascript
Category Web