Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
var pos=0;
var str="Chuỗi muốn chạy trên thanh tiêu đề của trình duyệt";
// npos is used for forward scrolling
var npos=str.length;
// Normal upDate(). Other options upDateFW() and upDateWD()
setInterval("upDate()",300);
// Normal Scroll
function upDate()
{
// Reset the title starting at pos
document.title=str.substring(pos,str.length)+str.substring(0,pos);
if(pos < str.length) pos++;
else pos = 0;
}
// Scroll forward
function upDateFW()
{
// Reset the title starting at pos
document.title=str.substring(npos,str.length)+str.substring(0,npos);
if(npos > 0) npos--;
else npos = str.length;
}
// Scroll With Delay
var delay = 20;
function upDateWD()
{
if(pos < str.length) {
document.title=str.substring(pos,str.length)+str.substring(0,pos);
} else {
if(pos > str.length+delay) {
pos = 0;
}
}
pos++;
}
var Message="Welcome to my site";
var place=1;
function scrollIn() {
window.status=Message.substring(0, place);
if (place >= Message.length) {
place=1;
window.setTimeout("scrollOut()",300);
} else {
place++;
window.setTimeout("scrollIn()",50);
}
}
function scrollOut() {
window.status=Message.substring(place, Message.length);
if (place >= Message.length) {
place=1;
window.setTimeout("scrollIn()", 100);
} else {
place++;
window.setTimeout("scrollOut()", 50);
}
}
Để giữa 2 tag <script language="javascript"> và </script>ma` bạn ơi để trong code nào mới được vậy?
Bạn chỉ cần thay đổi giá trị ở:em cũng ko hiểu phải dùng code của bác Agumon như thế nào cả
hướng dẫn chi tiết hơn được ko vậy
var str="Chuỗi muốn chạy trên thanh tiêu đề của trình duyệt";
var str="Welcome to my site";
<html>
<head>
<script language="javascript">
<!--
var Message="Welcome to my site";
var place=1;
function scrollIn() {
window.status=Message.substring(0, place);
if (place >= Message.length) {
place=1;
window.setTimeout("scrollOut()",300);
} else {
place++;
window.setTimeout("scrollIn()",50);
}
}
function scrollOut() {
window.status=Message.substring(place, Message.length);
if (place >= Message.length) {
place=1;
window.setTimeout("scrollIn()", 100);
} else {
place++;
window.setTimeout("scrollOut()", 50);
}
}
//-->
</script>
...
</head>
<body onLoad="scrollIn();">
...
</body>
</html>
Bạn muốn nói dòng chữ cuộn ở đầu trang phải không?boycodon2 nói:còn kiếu chạy chữ như vầy thì làm sao http://baihathay.net.tf làm cách nào vậy!
<marquee scrollDelay="50">Welcome!!!</marquee>