You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
817 B
JavaScript

/*!
* depend on Jquery
*/
$(function() {
$(".nav-content").stick_in_parent({parent:'#stick_row', offset_top: 30});
$("a[href^='#']").on('click', function(e) {
e.preventDefault(); // prevent hard jump, the default behavior
scrollTo($(this));
return false;
});
});
function scrollTo(obj) {
var target = $(obj).attr("href"); // Set the target as variable
// perform animated scrolling by getting top-position of target-element and set it as scroll target
var target_load = $(target).offset().top-65;
$('html, body').stop().animate({
scrollTop: target_load
}, 600, function() {
// location.hash = target; //attach the hash (#jumptarget) to the pageurl
});
$(obj).parents("ul").find("a").removeClass("active");
$(obj).addClass("active");
return false;
}