Liên kết web cấp trên

  • truy cập   (chi tiết)
    trong hôm nay
  • lượt xem
    trong hôm nay
  • thành viên
  • 20 khách và 0 thành viên

    DANH SÁCH THƯ VIỆN

    Quản trị blog



    - Admin: Vũ Vân Phong
    - Sinh ngày: 1978
    - Quê: Thái Thụy, Thái Bình
    - Chuyên môn: Toán - Lý
    - Đơn vị công tác: Trường THCS Thụy An-Thái Thụy-Thái Bình
    - Sở thích: Công nghệ thông tin!
    - Liên hệ email: vuvanphong@thaithuy.edu.vn
    - ĐT: 0977 544 809
    - Lập web:13/8/2009

    GIAO DIỆN

    Gốc > Code cho blog >

    Code tuyết rơi sử dụng ảnh

     - Hiệu ứng tuyết rơi sử dụng ảnh
    - Tải hình ảnh tuyết rơi ở đây ( có nhiều kiểu để chọn )
    http://www.mediafire.com/?g79le58ol8o5rer

    code như sau:

     

    <script>
    var SNOW_Picture = "/billeder/snow.gif";
    var SNOW_no = 15;

    var SNOW_browser_IE_NS = (document.body.clientHeight) ? 1 : 0;
    var SNOW_browser_MOZ = (self.innerWidth) ? 1 : 0;
    var SNOW_browser_IE7 = (document.documentElement.clientHeight) ? 1 : 0;

    var SNOW_Time;
    var SNOW_dx, SNOW_xp, SNOW_yp;
    var SNOW_am, SNOW_stx, SNOW_sty;
    var i, SNOW_Browser_Width, SNOW_Browser_Height;

    if (SNOW_browser_IE_NS)
    {
    SNOW_Browser_Width = document.body.clientWidth;
    SNOW_Browser_Height = document.body.clientHeight;
    }
    else if (SNOW_browser_MOZ)
    {
    SNOW_Browser_Width = self.innerWidth - 20;
    SNOW_Browser_Height = self.innerHeight;
    }
    else if (SNOW_browser_IE7)
    {
    SNOW_Browser_Width = document.documentElement.clientWidth;
    SNOW_Browser_Height = document.documentElement.clientHeight;
    }


    SNOW_dx = new Array();
    SNOW_xp = new Array();
    SNOW_yp = new Array();
    SNOW_am = new Array();
    SNOW_stx = new Array();
    SNOW_sty = new Array();

    for (i = 0; i < SNOW_no; ++ i)
    {
    SNOW_dx[i] = 0;
    SNOW_xp[i] = Math.random()*(SNOW_Browser_Width-50);
    SNOW_yp[i] = Math.random()*SNOW_Browser_Height;
    SNOW_am[i] = Math.random()*20;
    SNOW_stx[i] = 0.02 + Math.random()/10;
    SNOW_sty[i] = 0.7 + Math.random();
    if (i == 0) document.write("<\div id=\"SNOW_flake"+ i +"\" style=\"position: absolute; z-index: "+ i +"; visibility: visible; top: 15px; left: 15px;\"><a href=\"http://www.peters1.dk\" target=\"_blank\"><\img src=\""+SNOW_Picture+"\" border=\"0\"></a><\/div>");
    else document.write("<\div id=\"SNOW_flake"+ i +"\" style=\"position: absolute; z-index: "+ i +"; visibility: visible; top: 15px; left: 15px;\"><\img src=\""+SNOW_Picture+"\" border=\"0\"><\/div>");
    }

    function SNOW_Weather()
    {

    for (i = 0; i < SNOW_no; ++ i)
    {
    SNOW_yp[i] += SNOW_sty[i];

    if (SNOW_yp[i] > SNOW_Browser_Height-50)
    {
    SNOW_xp[i] = Math.random()*(SNOW_Browser_Width-SNOW_am[i]-30);
    SNOW_yp[i] = 0;
    SNOW_stx[i] = 0.02 + Math.random()/10;
    SNOW_sty[i] = 0.7 + Math.random();
    }

    SNOW_dx[i] += SNOW_stx[i];

    document.getElementById("SNOW_flake"+i).style.top=SNOW_yp[i]+"px";
    document.getElementById("SNOW_flake"+i).style.left=SNOW_xp[i] + SNOW_am[i]*Math.sin(SNOW_dx[i])+"px";
    }

    SNOW_Time = setTimeout("SNOW_Weather()", 10);

    }

    SNOW_Weather();
    </script>

     Cho vào khối chức năng.


    Nhắn tin cho tác giả
    Vũ Vân Phong @ 16:09 15/03/2011
    Số lượt xem: 1503
    Số lượt thích: 0 người
    Avatar

    Code tuyết rơi sử dụng ảnh

     
    Gửi ý kiến

    Bảng thử code

    Blog giáo viên Thái Bình

    http://vuvanphong.violet.vn : cám ơn đã sử dụng chương trình