Created
September 5, 2018 04:29
-
-
Save tienminhvy/5d1608f3c31b288e9651e08ad4f061f0 to your computer and use it in GitHub Desktop.
Script Chuyển hướng trang Web
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Script Chuyển trang</title> | |
</head> | |
<body> | |
<!--Để chuyển hướng sang site bạn muốn, chỉnh tên miền http://example.com thành tên miền của bạn!--> | |
<!--Copy từ Start đến End--> | |
<!--Start--> | |
<script type="text/javascript"> | |
var count = 10; | |
var redirect = "http://example.com"; | |
function countDown(){ | |
var timer = document.getElementById("timer"); | |
if(count > 0){ | |
count--; | |
timer.innerHTML = "Chuyển hướng sang đấy trong <b>"+count+"</b> giây nữa!"; | |
setTimeout("countDown()", 1000); | |
}else{ | |
window.location.href = redirect; | |
} | |
} | |
</script> | |
<style> | |
.wrap { | |
width: 600px; | |
margin: 250px auto; | |
padding: 20px; | |
border-radius: 10px; | |
border: 1px solid #ddd; | |
font-size: 20px; | |
line-height: 1.3em; | |
text-align: center; | |
} | |
</style> | |
<div class="wrap"> | |
<p id="timer"><script type="text/javascript">countDown();</script></p> | |
</div> | |
<!--End--> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
F bro