css样式
Home > Web Front-end > JS Tutorial > jquery custom container rain effect can change the rain icon to something else_jquery

jquery custom container rain effect can change the rain icon to something else_jquery

WBOY
Release: 2016-05-16 16:51:24
Original
1279 people have browsed it
jquery custom container rain effect can change the rain icon to something else_jquery
css style
Copy code The code is as follows:



javascript
Copy code The code is as follows:

<script> <br><br>//width:400, <br>//height:300, <br>//pic:' water-drop.png', //The default rain picture is water-drop.png <br>//speed:1000, //Rain speed<br>//num:100, //Density of raindrops<br> //dir:['right',160], //The default direction of rain is the deviation of raindrops to the right<br><br><br>$(function(){ <br>$(".container" ).Rain({width:'500',dir:['right',100],speed:3000,num:100,func:back_func}); <br><br><br>}) <br>var i =0; <br>function back_func(d){ <br>if(parseInt($(".box").position()['left'] $(".box").width())> d&&d>parseInt($(".box").position()['left'])){ <br>if(i>$(".box").height()){ <br>$(". box .water").animate({height:0}); <br>i=0; <br>return; <br>} <br>$(".box .water").animate({height:i }); <br>} <br><br>if(parseInt($(".box2").position()['left'] $(".box2").width())>d&&d>parseInt ($(".box2").position()['left'])){ <br>if(i>$(".box2").height()){ <br>$(".box2 .water ").animate({height:0}); <br>i=0; <br>return; <br>} <br>$(".box2 .water").animate({height:i }); <br>} <br>} <br></script>

html

< ;div class="water">

All is OK
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template