Tạo hiệu ứng tuyết rơi và ông già Noel di chuyển trên blogspot trang trí Noel cực đẹp

Bài viết này mình sẽ giới thiệu đến các bạn đoạn CSS, HTML và JAVASCRIPT tạo hiệu ứng tuyết rơi tuyệt đẹp và ông già noel di chuyển trên blogspot. Code cũng không ảnh hưởng mấy tới tốc độ của blog nên các bạn không cần quan tâm về nó.
Demo các bạn có thể xem ở blog của mình.
Tạo hiệu ứng tuyết rơi và ông già Noel di chuyển trên blogspot

Các bước thực hiện

Bước 1: Truy cập vào trang chỉnh sửa HTML của Blogspot.
Bước 2: Dán 2 đoạn code phía dưới và trước thẻ </body>

Code hiệu ứng tuyết rơi

<style type="text/css">
.snow-container { position:fixed; width:100%; max-width:100%; z-index:99999; pointer-events:none; overflow:hidden; top:0; height:100% }
.snow { display:block; position:absolute; z-index:2; top:0; right:0; bottom:0; left:0; pointer-events:none; -webkit-transform:translate3d(0,-100%,0); transform:translate3d(0,-100%,0); -webkit-animation:snow linear infinite; animation:snow linear infinite }
.snow.foreground { background-image:url("https://2.bp.blogspot.com/-Wy6UPSscdjQ/WiaUVdMxwvI/AAAAAAAAAUU/VlYKpmYGGGskfkn9gc9yKYx-TNKArubPACLcBGAs/s1600/snow-effect-_---------BacSiWindows-Com.png "); -webkit-animation-duration:15s; animation-duration:10s }
.snow.foreground.layered { -webkit-animation-delay:7.5s; animation-delay:7.5s }
.snow.middleground { background-image:url(https://dl6rt3mwcjzxg.cloudfront.net/assets/snow/snow-medium-0b8a5e0732315b68e1f54185be7a1ad9.png); -webkit-animation-duration:20s; animation-duration:15s }
.snow.middleground.layered { -webkit-animation-delay:10s; animation-delay:10s }
.snow.background { background-image:url(https://2.bp.blogspot.com/-cZWwrfEYtMI/WiaUgSmqv6I/AAAAAAAAAUY/fayIXcjKnvoWtHL-x-2H2oO5-Ks2e6_nQCLcBGAs/s1600/snow-effect_-_--------------BacSiWindows-Com.png); -webkit-animation-duration:25s; animation-duration:20s }
.snow.background.layered { -webkit-animation-delay:12.5s; animation-delay:12.5s }
@-webkit-keyframes snow {
0% { -webkit-transform:translate3d(0,-100%,0); transform:translate3d(0,-100%,0) } 100% { -webkit-transform:translate3d(5%,100%,0); transform:translate3d(5%,100%,0) }
}
@keyframes snow {
0% { -webkit-transform:translate3d(0,-100%,0); transform:translate3d(0,-100%,0) } 100% { -webkit-transform:translate3d(5%,100%,0); transform:translate3d(5%,100%,0) }
}
</style>
<div class='snow-container'><div class='snow foreground'/><div class='snow foreground layered'/><div class='snow middleground'/><div class='snow middleground layered'/><div class='snow background'/><div class='snow background layered'/></div> code-xml

Code ông già Noel di chuyển

<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'type='text/javascript'></script>
<script type='text/javascript'>
//<![CDATA[
$(function(){$('html').append('<img id="halo" title="Happy Noel" style="cursor:pointer; position:fixed; z-index:99999" height="120" src="https://lh3.ggpht.com/-LSDhJFNSG-E/VnQh0rSGAHI/AAAAAAAADoo/3FdK8o-hZ6A/s1600/tuan_loc_cho_qua_cua_ong_gia_noel_anh.gif"/>')
setInterval(function(){var $X=Math.ceil(Math.random()*$(window).width())
var $Y=Math.ceil(Math.random()*$(window).height())
$('img#halo').animate( { 'left':$X,'top':$Y }
,5000)}
,5000)
$('img#halo').click(function() { window.open('https://lh3.ggpht.com/-LSDhJFNSG-E/VnQh0rSGAHI/AAAAAAAADoo/3FdK8o-hZ6A/s1600/tuan_loc_cho_qua_cua_ong_gia_noel_anh.gif','') }
)}
)
//]]>
</script> code-js
Lưu ý: Nếu blog của các bạn có thư viện jquery rồi thì các bạn xóa đoạn
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js'type='text/javascript'></script> code-xml
trong code 2 đi
Chúc các bạn thành công!
Nguồn: Bác Sỉ Window và dinhboblog
Những câu hỏi thường gặp
Làm thế nào để tải về?

Nếu bạn chưa tải file thông qua link rút gọn bao giờ, thì bạn có thể xem hướng dẫn để tải về.

Tệp tin tải về không đúng với mô tả?

Nếu có sự nhầm lẫn giữa mô tả và tệp tin tải về, vui lòng báo lỗi với chúng tôi thông qua mục liên hệ dưới cuối trang.

Link hỏng?

Nếu bạn gặp vấn đề về liên kết ví dụ như tệp không tồn tại, không thể truy cập,...vui lòng báo cáo với quản trị viên.

Tôi không thể mở và chỉnh sửa file psd?

Vui lòng xem hướng dẫn nếu bạn chưa biết cách mở file psd và edit nó.

5/Post a Comment/Comments

Sắp xếp theo