Đây là code mà bạn có thể sử dụng để tạo các câu nói ngẫu nhiên tùy ý.
Good Luck!
- Code:
<script language="JavaScript">
/*
This script downloaded from [You must be registered and logged in to see this link.]
Come to view and download over 2000+ free javascript at [You must be registered and logged in to see this link.]
*/
function rotateEvery(sec)
{
var Quotation=new Array()
// QUOTATIONS
Quotation[0] = 'Ăn tranh thủ ngủ khẩn trương, học bt chơi là chính';
Quotation[1] = 'yêu là khổ, biết thế đéo yêu cho song';
Quotation[2] = 'Nếu biết ngày mai em đi lấy chồng anh về lấy vợ thế là xong';
Quotation[3] = 'mai sau con anh nó lớn nó lấy con em để trả thù';
Quotation[4] = 'Fifth quotation';
Quotation[5] = 'Sixth quotation';
Quotation[6] = 'You can add <b>as many</b> quotations <b>as you like</b>';
var which = Math.round(Math.random()*(Quotation.length - 1));
document.getElementById('textrotator').innerHTML = Quotation[which];
setTimeout('rotateEvery('+sec+')', sec*1000);
}
</script>
</head>
<body onload="rotateEvery(1)">
<div id="textrotator"><!--Quotations will be displayed here--></div>
Good Luck!