1 2 3 4 5 6 |
<?php // File Security Check if ( ! empty( $_SERVER['SCRIPT_FILENAME'] ) && basename( __FILE__ ) == basename( $_SERVER['SCRIPT_FILENAME'] ) ) { die ( 'You do not have sufficient permissions to access this page!' ); } ?> |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
jQuery(document).ready(function($) { $(".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}, 2000,'swing'); }); }); |