일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- #이미지
- javascript
- 홈페이지제작
- #jQuery
- 솔루션
- 이미지
- 홈페이지
- 게시판
- #image
- CGIMALL
- #웹솔루션
- CSS
- #cgimall
- jquery
- #CSS
- #happycgi
- php
- #홈페이지
- 해피CGI
- #동영상
- happycgi
- 해피씨지아이
- #업종별
- #솔루션
- #해피CGI
- 사이트제작
- #쇼핑몰
- 웹솔루션
- #홈페이지제작
- #뉴스
- Today
- Total
웹솔루션개발 25년 노하우! 해피CGI의 모든것
[해피CGI][cgimall] CSS RAIN 본문
비가 내리는 효과를 만들 수 있습니다.
코드 및 데모는 데모링크를 통해서 확인하실 수 있습니다.
[HTML 소스]
<section class="rain"></section>
[CSS 소스]
html{height:100%;}
body {
background:#0D343A;
background:-webkit-gradient(linear,0% 0%,0% 100%, from(rgba(13,52,58,1) ), to(#000000) );
background: -moz-linear-gradient(top, rgba(13,52,58,1) 0%, rgba(0,0,0,1) 100%);
overflow:hidden;}
.drop {
background:-webkit-gradient(linear,0% 0%,0% 100%, from(rgba(13,52,58,1) ), to(rgba(255,255,255,0.6)) );
background: -moz-linear-gradient(top, rgba(13,52,58,1) 0%, rgba(255,255,255,.6) 100%);
width:1px;
height:89px;
position: absolute;
bottom:200px;
-webkit-animation: fall .63s linear infinite;
-moz-animation: fall .63s linear infinite;
}
/* animate the drops*/
@-webkit-keyframes fall {
to {margin-top:900px;}
}
@-moz-keyframes fall {
to {margin-top:900px;}
}
[JS 소스]
// number of drops created.
var nbDrop = 858;
// function to generate a random number range.
function randRange( minNum, maxNum) {
return (Math.floor(Math.random() * (maxNum - minNum + 1)) + minNum);
}
// function to generate drops
function createRain() {
for( i=1;i<nbDrop;i++) {
var dropLeft = randRange(0,1600);
var dropTop = randRange(-1000,1400);
$('.rain').append('<div class="drop" id="drop'+i+'"></div>');
$('#drop'+i).css('left',dropLeft);
$('#drop'+i).css('top',dropTop);
}
}
// Make it rain
createRain();
'웹프로그램밍 자료실 > JAVA 자료' 카테고리의 다른 글
Comments