main.js 792 B

1234567891011121314151617181920212223242526272829
  1. var amountScrolled = 300;
  2. $(document).ready( function(){
  3. $(window).scroll(function() {
  4. if ( $(window).scrollTop() > amountScrolled ) {
  5. $('#botom-corner').fadeIn('slow');
  6. } else {
  7. $('#botom-corner').fadeOut('slow');
  8. }
  9. });
  10. } );
  11. $(function(){
  12. $('#go-top').click(function() {
  13. if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
  14. && location.hostname == this.hostname) {
  15. var $target = $(this.hash);
  16. $target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
  17. if ($target.length) {
  18. var targetOffset = $target.offset().top;
  19. $('html,body').animate({scrollTop: targetOffset}, 1000);
  20. return false;
  21. }
  22. }
  23. });
  24. });