Difference between revisions of "Template:Team:CHINA CD UESTC/basicjs"
(Created page with "function gotoTop(acceleration,stime) { acceleration = acceleration || 0.1; stime = stime || 10; var x1 = 0; var y1 = 0; var x2 = 0; var y2 = 0; var x3 = 0...") |
|||
Line 1: | Line 1: | ||
− | function | + | $(function(){ |
− | + | $(window).scroll(function() { | |
− | + | if($(window).scrollTop() >= 100){ //????????????ֵʱ???????С??~ | |
− | + | $('.actGotop').fadeIn(300); //?????????䣬ԽС???????? | |
− | + | }else{ | |
− | + | $('.actGotop').fadeOut(300); //??????????䣬ԽС?ʧ????? | |
− | + | } | |
− | + | }); | |
− | + | $('.actGotop').click(function(){$('html,body').animate({scrollTop: '0px'}, 800);}); //??????ͣ????䣬ԽС?ʧ????? | |
− | + | }); | |
− | + | </script> | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | } | + |
Revision as of 14:00, 15 September 2015
$(function(){ $(window).scroll(function() { if($(window).scrollTop() >= 100){ //????????????ֵʱ???????С??~ $('.actGotop').fadeIn(300); //?????????䣬ԽС???????? }else{ $('.actGotop').fadeOut(300); //??????????䣬ԽС?ʧ????? } }); $('.actGotop').click(function(){$('html,body').animate({scrollTop: '0px'}, 800);}); //??????ͣ????䣬ԽС?ʧ????? }); </script>