Skip to main content
Thông báo
Chào mừng bạn ghé thăm wap TatCa.Yn.Lt của chúng tôi!
Nếu bạn phát hiện thấy có gì bất thường như (vi phạm bản quyền, link die, lỗi code...).
Hãy thông báo cho Admin tại nhóm FaceBook hoặc kênh YouTube: Shared Channel biết để khắc phục ngay...
Chân thành cảm ơn và chúc vui vẻ..!
Tiện ích
Loading...
Tìm kiếm nhanh

↓↓ Code hiệu ứng sao rơi đẹp

* Duy_Doanh
* 08:42, 17/12/2016
view lượt xem
Với code này chắc hẳn sẽ làm wap bạn trở nên lung linh hơn đấy. Mình sưu tầm lâu rồi nên cũng không nhớ nguồn và có mod lại chút xíu.
Code rất nhẹ, bạn copy về đặt vào wap nhé...

Demo: http://tatca.yn.lt/test/sao-roi

Demo ảnh:

Code của bạn đây:

Code:


<!-- Hiệu ứng sao rơi cho wap/web/blog Duy_Doanh -->
<script type='text/javascript'>
//<![CDATA[
var snowsrc="http://tatca.yn.lt/icon/sao.png" // Thay Link hình của bạn vào đây (để nguyên cũng được)
var no = 15; // Số ảnh rơi trên blog
var hidesnowtime =0; // Số giây ảnh biến mất sau khi rơi
var snowdistance = "pageheight"; // Có thể thay đổi giá trị pageheight thành windowheight

///////////Stop Config//////////////////////////////////

var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

var dx, xp, yp; // coordinate and position variables
var am, stx, sty; // amplitude and step variables
var i, doc_width = 800, doc_height = 600;

if (ns6up) {
doc_width = self.innerWidth;
doc_height = self.innerHeight;
} else if (ie4up) {
doc_width = iecompattest().clientWidth;
doc_height = iecompattest().clientHeight;
}

dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
snowsrc=(snowsrc.indexOf("dynamicdrive.com")!=-1)? "snow.gif" : snowsrc
for 0 {
dx = 0; // set coordinate variables
xp = Math.random-50; // set position variables
yp = Math.random()*doc_height;
am = Math.random()*20; // set amplitude variables
stx = 0.02 + Math.random()/10; // set step variables
sty = 0.7 + Math.random(); // set step variables
if (ie4up||ns6up) {
if (i == 0) {
document.write0;
} else {
document.write0;
}
}
}

function snowIE_NS6() { // IE and NS6 main animation function
doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;
doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")? iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;
for 0 { // iterate for every dot
yp += sty;
if -50 {
xp = Math.random-30;
yp = 0;
stx = 0.02 + Math.random()/10;
sty = 0.7 + Math.random();
}
dx += stx;
document.getElementById0.style.top=yp+"px";
document.getElementById0.style.left=xp + am*Math.sin(dx)+"px";
}
snowtimer=setTimeout("snowIE_NS6()", 10);
}

function hidesnow(){
if (window.snowtimer) clearTimeout(snowtimer)
for 0 document.getElementById0.style.visibility="hidden"
}

if (ie4up||ns6up){
snowIE_NS6();
if (hidesnowtime>0)
setTimeout("hidesnow()", hidesnowtime*1000)
}
//">">>
</script>
<!--End hiệu ứng sao rơi cho wap/web/blog Duy_Doanh -->
Copy code

Chúc thành công..!
↑↑ Đánh giá bài viết
like     like

sao

Chia sẻ bài viết ???
- Chia sẻ tới: - facebook - G - Z - T
BBCode:

Link:
Cùng chuyên mục
Bạn đã xem chưa?
Thống kê truy cập

XtGem Forum catalog