filmov
tv
JavaScript setTimeout() Function | Make Loading page in HTML & JavaScript - JavaScript Tutorial 110
![preview_player](https://i.ytimg.com/vi/aftAZbNjL4M/maxresdefault.jpg)
Показать описание
Notes for You:: JavaScript setTimeout(functionName, delayTime) function.
- executes a function after a specified delay time.
Example Code 1:
<p id="firstp">Some Text </p>
<script type="text/javascript">
setTimeout(changeText,3000);
function changeText()
{
}
</script>
Example Code 2: Loader page with HTML, CSS and JavaScript.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JavaScript Timing Functions</title>
<style type="text/css">
#loader
{
width:50px;
height:50px;
background-color:white;
border:10px solid lightgray;
border-top:10px solid black;
border-radius:50%;
animation-name:rotateLoader;
animation-duration:1s;
animation-iteration-count:infinite;
position:absolute;
top:40%;
left:40%;
}
@keyframes rotateLoader
{
from { transform:rotate(0deg); }
to { transform:rotate(360deg); }
}
</style>
</head>
<body>
<div id="loader">
</div>
<script type="text/javascript">
setTimeout(loadNextPage,3000);
function loadNextPage()
{
}
</script>
</body>
</html>
Note:
- replace < with less-than symbol.
- replace > with greater-than symbol.
=========================================
Follow the link for next video:
JavaScript setInterval() Function | Make Timer in JavaScript - JavaScript Tutorial 111
Follow the link for previous video:
JavaScript Events with Return value - JavaScript Tutorial 109
=========================================
JavaScript Tutorials Playlist:-
=========================================
Watch My Other Useful Tutorials:-
jQuery Tutorials Playlist:-
jQuery UI Tutorials Playlist:-
Bootstrap Tutorials Playlist:-
=========================================
► Subscribe to our YouTube channel:
► Visit our Website:
=========================================
Hash Tags:-
#ChidresTechTutorials #JavaScript #JavaScriptTutorial
- executes a function after a specified delay time.
Example Code 1:
<p id="firstp">Some Text </p>
<script type="text/javascript">
setTimeout(changeText,3000);
function changeText()
{
}
</script>
Example Code 2: Loader page with HTML, CSS and JavaScript.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JavaScript Timing Functions</title>
<style type="text/css">
#loader
{
width:50px;
height:50px;
background-color:white;
border:10px solid lightgray;
border-top:10px solid black;
border-radius:50%;
animation-name:rotateLoader;
animation-duration:1s;
animation-iteration-count:infinite;
position:absolute;
top:40%;
left:40%;
}
@keyframes rotateLoader
{
from { transform:rotate(0deg); }
to { transform:rotate(360deg); }
}
</style>
</head>
<body>
<div id="loader">
</div>
<script type="text/javascript">
setTimeout(loadNextPage,3000);
function loadNextPage()
{
}
</script>
</body>
</html>
Note:
- replace < with less-than symbol.
- replace > with greater-than symbol.
=========================================
Follow the link for next video:
JavaScript setInterval() Function | Make Timer in JavaScript - JavaScript Tutorial 111
Follow the link for previous video:
JavaScript Events with Return value - JavaScript Tutorial 109
=========================================
JavaScript Tutorials Playlist:-
=========================================
Watch My Other Useful Tutorials:-
jQuery Tutorials Playlist:-
jQuery UI Tutorials Playlist:-
Bootstrap Tutorials Playlist:-
=========================================
► Subscribe to our YouTube channel:
► Visit our Website:
=========================================
Hash Tags:-
#ChidresTechTutorials #JavaScript #JavaScriptTutorial
Комментарии