Team:UCLA/Template/Javascript

From 2014.igem.org

(Difference between revisions)
Line 104: Line 104:
//go to destination
//go to destination
$('html,body').animate({scrollTop:dest}, 700,'swing');
$('html,body').animate({scrollTop:dest}, 700,'swing');
-
});
 
-
</script>
 
-
 
-
<!--MAIN NAVBAR-->
 
-
<script>
 
-
$(function(){
 
-
$('.dropdown').hover(function(){
 
-
  $('.dropdown-toggle', this).trigger('click');
 
});
});
</script>
</script>
Line 149: Line 141:
$('html,body').animate({scrollTop:dest}, 700,'swing');
$('html,body').animate({scrollTop:dest}, 700,'swing');
});
});
-
</script>
 
-
 
-
<!--SLIDING SIDE BAR-->
 
-
<script type="text/javascript">
 
-
$("#menu-toggle").click(function(e) {
 
-
        e.preventDefault();
 
-
        $("#wrapper").toggleClass("active");
 
-
    });
 
-
 
-
    $('body').scrollspy({ target: '#spy', offset:80});
 
-
 
-
 
-
    $('a[href*=#]:not([href=#])').click(function() {
 
-
        if (location.pathname.replace(/^\//, '') == this.pathname.replace(/^\//, '') || location.hostname == this.hostname) {
 
-
 
-
            var target = $(this.hash);
 
-
            target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
 
-
            if (target.length) {
 
-
                $('html,body').animate({
 
-
                    scrollTop: target.offset().top
 
-
                }, 1000);
 
-
                return false;
 
-
            }
 
-
        }
 
-
    });
 
</script>
</script>
</html>
</html>

Revision as of 22:47, 7 August 2014