Reread tags scripts and style with js

Asked

Viewed 27 times

1

inserir a descrição da imagem aqui

I have these tags scripts that serve to adjust and give functions to a carousel. However I am adding the carousel as soon as I click on a button, however as the page has already been rendered these scripts end up having no effect on the carousel that has been added. How can I get these tags to be "reread" once I click the button? I believe that if they are read by the browser after I have added the carousel, the scripts sutam effect.

1 answer

0

Reloading scripts will not help.

Depending on your framework, it is possible that it will try to start some plugins automatically when the window is loaded, even if you remove and insert the scripts again, window.onload events will not be invoked again.

In this case if you decide to add another carousel after the page is already loaded, you have to start these plugins manually. How to do this? I have no way to answer you, it will vary from your framework’s API. Probably something like $('#meu_carrossel').carrossel(), try to check the documentation.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.