Implement a callback function: (a function that involves animation to execute a statement)
$ ("P"). Hide (+,function() {alert ("the paragraph is now hidden");});
Write for yourself:
<script type= "Text/javascript" >//$ (document). Ready (function () {//$ (window). Scroll (function () {// //Alert ($ (window). scrolltop () + "px");// // }$ (document). Ready (function() {$ (window). Scroll (function() { if(($ (window). scrolltop ()) > 500){ $(". F_a"). Animate ({marginleft: "0px", opacity: ' 1 ', Speed: "1500"},function(){ $(". F_aa"). Animate ({marginleft:"0px", opacity:' 1 ', Speed:"Slow" },2000); }); } if(($ (window). scrolltop ()) > 500){ $(". F_b"). Animate ({marginright: "0px", opacity: ' 1 '},function(){ $(". F_bb"). Animate ({marginright:"0px", opacity:' 1 ' },2000); }); } //$ ("P"). Hide (1000,function () {//alert ("The paragraph is now hidden");// }); if(($ (window). scrolltop ()) > 1800){ $(". F_c"). Animate ({marginleft: "0px", opacity: ' 1 '},function(){ $(". F_cc"). Animate ({marginleft:"0px", opacity:' 1 ' },2000); }); } if(($ (window). scrolltop ()) > 1800){ $(". F_d"). Animate ({marginright: "0px", opacity: ' 1 '},function(){ $(". F_dd"). Animate ({marginright:"0px", opacity:' 1 ' },2000); }); } //if (($ (window). scrolltop ()) > 3200) {//$ (". F_e"). Animate ({//margintop: "40px",//opacity: ' 1 '// });// } if(($ (window). scrolltop ()) > 3200){ $(". F_e"). Animate ({margintop: "40px", Opacity: ' 1 '},function(){ $(". F_ee"). Animate ({margintop: "40px", Opacity: ' 1 '},function(){ $(". F_eee"). Animate ({margintop:"40px", opacity:' 1 ' }); }); }); } if(($ (window). scrolltop ()) > 4100){ $(". F_f"). Animate ({margintop:"40px", opacity:' 1 ' }); } }); });</script>
Write yourself a jquery implementation when the scrollbar is sliding to a position to move toward the middle