0
How can i make the 2nd script tag code to be loaded after 3 seconds or after a certain element loads
<head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("div:contains(This Text)").css("display", "none"); }); </script> <script> $(function() { $("#contentPost").delay(1000).fadeIn(500); }); </script> </head> <body> <div id="contentPost">This text.</div> </body>
2 Antworten
+ 1
look into scheduling calls, we might like to do things at set times set orders thus scheduling a call. some ways javascript does this can be setTimeout allows to run a function once after the interval of time.
setInterval allows to run a function regularly with the interval between the runs.
+ 1
пройди до конца курс javascript и ты узнаешь эту тайну