|
|
Line 1: |
Line 1: |
| <html> | | <html> |
| <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> | | <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> |
- | <!-- SAM'S CAROUSEL EDIT SORRY AGAIN -->
| |
- | <script type="text/javascript">
| |
- | $(".scroll").click(function(event){
| |
- | event.preventDefault();
| |
- | //calculate destination place
| |
- | var dest=0;
| |
- | if($(this.hash).offset().top > $(document).height()-$(window).height()){
| |
- | dest=$(document).height()-$(window).height();
| |
- | }else{
| |
- | dest=$(this.hash).offset().top;
| |
- | }
| |
- | //go to destination
| |
- | $('html,body').animate({scrollTop:dest}, 700,'swing');
| |
- | });
| |
- | </script>
| |
- |
| |
| <!--MAIN NAVBAR--> | | <!--MAIN NAVBAR--> |
| <script> | | <script> |
Line 22: |
Line 6: |
| $('.dropdown').hover(function(){ | | $('.dropdown').hover(function(){ |
| $('.dropdown-toggle', this).trigger('click'); | | $('.dropdown-toggle', this).trigger('click'); |
- | });
| |
- | </script>
| |
- |
| |
- | <!--BACK TO TOP BUTTON-->
| |
- | <script type="text/javascript">
| |
- | $(function(){
| |
- | $(document).on( 'scroll', function(){
| |
- | if ($(window).scrollTop() > 100) {
| |
- | $('.scroll-top-wrapper').addClass('show');
| |
- | } else {
| |
- | $('.scroll-top-wrapper').removeClass('show');
| |
- | }
| |
- | });
| |
- | $('.scroll-top-wrapper').on('click', scrollToTop);
| |
- | });
| |
- |
| |
- | function scrollToTop() {
| |
- | verticalOffset = typeof(verticalOffset) != 'undefined' ? verticalOffset : 0;
| |
- | element = $('body');
| |
- | offset = element.offset();
| |
- | offsetTop = offset.top;
| |
- | $('html, body').animate({scrollTop: offsetTop},700, 'swing');
| |
- | };
| |
- |
| |
- |
| |
- | $(".scroll").click(function(event){
| |
- | event.preventDefault();
| |
- | //calculate destination place
| |
- | var dest=0;
| |
- | if($(this.hash).offset().top > $(document).height()-$(window).height()){
| |
- | dest=$(document).height()-$(window).height();
| |
- | }else{
| |
- | dest=$(this.hash).offset().top;
| |
- | }
| |
- | //go to destination
| |
- | $('html,body').animate({scrollTop:dest}, 700,'swing');
| |
| }); | | }); |
| </script> | | </script> |