Remove plugin from Javascript elements

1

I am using the lightcase.js plugin to make a carousel of images. How can I remove the plugin from the elements in which I have initialized the plugin, by means of the instruction:

$("a.item-lightcase").lightcase({
    transition: 'scrollHorizontal'
});

What I want is to remove the plugin from the elements whenever I want, and initialize it whenever I want.

Thank you.

    
asked by Developer 18.05.2017 в 09:26
source

2 answers

0

Every plugin usually has a .destroy () or .close (), test:

$("a.item-lightcase").destroy();
$("a.item-lightcase").close();
    
answered by 18.05.2017 / 09:59
source
0

Create an instance of the class:

var gallery = $("#a.item-lightcase").lightcase({
    transition: 'scrollHorizontal'
});

Then delete the instance with destroy() , as follows:

gallery.destroy();
    
answered by 18.05.2017 в 10:12