Template:Team:KIT-Kyoto/Scroll

From 2014.igem.org

(Difference between revisions)
 
(21 intermediate revisions not shown)
Line 4: Line 4:
$(".btn").click(function () {
$(".btn").click(function () {
var i = $(".btn").index(this)
var i = $(".btn").index(this)
-
var p = $(".sentence").eq(i).offset().top;
+
var p = $(".scroll").eq(i).offset().top;
-
$('html,body').animate({ scrollTop: p+60px }, 'fast');
+
              p -= 70;
 +
$('html,body').animate({ scrollTop: p }, 500, 'swing');
return false;
return false;
-
});
+
});     
 +
              var top = $('#page-top'); 
 +
              top.hide();
 +
              $(window).scroll(function () {
 +
                if ($(this).scrollTop() > 150) {top.fadeIn();}
 +
               else {top.fadeOut();}
 +
       });
 +
               top.click(function () {
 +
                $('body,html').animate({scrollTop: 0 }, 500, 'swing');
 +
               return false;
 +
       });
 +
});
-
$(".btn_top").click(function () {
 
-
$('html,body').animate({ scrollTop: 60px }, 'fast');
 
-
return false;
 
-
});
 
-
 
-
});
 
</script>
</script>

Latest revision as of 08:38, 15 September 2014