0
I would like you to help me in creating a javascript function so that, when loading a page, a button is automatically clicked every X seconds.
I tried to do this function but did not succeed and edited the text here in order to be better understood.
Logic:
When loading the page, a button should be clicked every X seconds.
Thank you very much for your personal attention.
You want when you click the button to be called the function
animaCarrosel
?– Sam
Exact. In this script I presented, the anima carrosel function changes only one div for another with images doing the replacements automatically. The idea of the function I need is to do "clicks" every X seconds on a button.
– Windsor Fernandes
then you don’t need to "click" on anything, just call the function from time to time:
setInterval(animaCarrosel, 3000);
. Will perform the function every 3 seconds.– Sam
I’m sorry, but I don’t think I made myself clear. Let me try to be assertive: This function I presented has the pattern I thought about at the level of image exchange without the need to click. I would like you to help me in a new function, which basically gives me the automatic action of clicking on a button every X seconds within a page. In this case my script was only presented to show where I was at the time of the attempt. Now, I think the idea would be to create a new function, this in turn with action on a button when loading the page. See if it’s clear because my intention is to be assertive.
– Windsor Fernandes
Unfortunately you could not be assertive. I recommend editing the question and be clearer.
– Sam
I edited the question friend. See if it was cleaner and clear. Thanks for the tip.
– Windsor Fernandes
Here’s an example https://stackoverflow.com/questions/39110102/trigger-mouse-clickon-a-button-each-5-seconds
– Bins
Our friend, really enlightened me on how to do it. Thanks for the tip. I managed a function based on that that presented me as an example and worked perfectly. Now I’m going to another venture that is to 'reset' the carousel at the end, but I believe that I will not have difficulty. Thank you very much for your help!
– Windsor Fernandes