Moving to bootstrap, still work to do... main header and footer done and some pages...
This commit is contained in:
34
js/scripts.js
Normal file
34
js/scripts.js
Normal file
@@ -0,0 +1,34 @@
|
||||
/* activate scrollspy menu */
|
||||
$('body').scrollspy({
|
||||
target: '#navbar-collapsible',
|
||||
offset: 52
|
||||
});
|
||||
|
||||
/* smooth scrolling sections */
|
||||
$('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 - 50
|
||||
}, 800);
|
||||
|
||||
if (this.hash=="#section1") {
|
||||
$('.scroll-up').hide();
|
||||
}
|
||||
else {
|
||||
$('.scroll-up').show();
|
||||
}
|
||||
|
||||
|
||||
// activte animations in this section
|
||||
target.find('.animate').delay(1200).addClass("animated");
|
||||
setTimeout(function(){
|
||||
target.find('.animated').removeClass("animated");
|
||||
},2000);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user