<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