I am running a script as follows:
Galleria.run(".showcase");
The problem is when there is no element with class ".showcase" a message is rendered on the page.
How can I run this code if an element with class .showcase is found in the page?
I am running a script as follows:
Galleria.run(".showcase");
The problem is when there is no element with class ".showcase" a message is rendered on the page.
How can I run this code if an element with class .showcase is found in the page?
var elements = document.getElementsByClassName('showcase');
if(elements.length){
Galleria.run(".showcase");
}