I have Jquery latest connected and working with other parts of application.
0. End goal: for a modal window to appear on the screen.
1. I click on a button.
2. A function runs that append a modal to body
3. With modals, in order for this modal to actually show on the screen, I need to press a button that has data-target="#EnterModalNameHere"
4. I make a hidden button in index.html that has the needed data-target
property.
5. I would like to be able to click this hidden button once the function in step 2 finishes appending the modal.
How can I tell Javascript "once finished appending modal, click on hidden button"?
You can create a custom Event which would be dispatch (trigger) immediately after the document is ready. So, in your situation, since you aren't using a media query, you can use :
setTimeout(() => { do something }, timeout);
. So, the timeout could be 1000 - which means 1sec and so on, window.onload = function() { enter code here }
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.