Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
SimoPcLorena
committed
Aug 27, 2012
1 parent
baa5f96
commit 702d655
Showing
2 changed files
with
73 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,62 @@ | ||
$(document).ready(function() { | ||
|
||
$(window).scroll(function() { // biography fix when scrolling up | ||
console.log($('html').offset().top); | ||
if ( $('html').offset().top == 0 ) { | ||
$('#navbar').find('.current').removeClass('current'); | ||
$('#navbar ul li a[href^="#bio"]').addClass('current'); | ||
} | ||
}); | ||
|
||
|
||
// var gOffset = 0; | ||
|
||
|
||
$('section').waypoint(function(event, direction) { | ||
|
||
var id = $(this).attr('id'); | ||
//console.log('id: '+$(this).attr('id')+', direction: '+direction); | ||
$('#navbar').find('.current').removeClass('current'); | ||
$('#navbar ul li a[href="#'+id+'"]').addClass('current'); | ||
|
||
// console.log('id: '+$(this).attr('id')+', direction: '+direction); | ||
// gOffset = direction === 'down' ? 160 : 0; | ||
// $.waypoints('refresh'); | ||
|
||
// console.log(gOffset); | ||
//console.log($('html').offset().top); | ||
|
||
}, { | ||
offset: 160 | ||
}); | ||
|
||
|
||
|
||
/* | ||
$(document).scrollTop(0); // quick reset in case user refreshes the page | ||
var OFFSET = 30; | ||
var HEADER_HEIGHT = parseInt($('#header').height()) + OFFSET; | ||
$('a[href^=#]:not([href=#])').click(function(e){ | ||
$('html, body') | ||
.animate({ | ||
scrollTop: $($(this).attr("href")) | ||
.offset().top - HEADER_HEIGHT }, 1200) | ||
.animate({ | ||
scrollTop: $($(this).attr("href")) | ||
.offset().top - HEADER_HEIGHT - 20 }, 300) | ||
.animate({ | ||
scrollTop: $($(this).attr("href")) | ||
.offset().top - HEADER_HEIGHT }, 600); | ||
e.preventDefault(); | ||
}); | ||
*/ | ||
|
||
|
||
|
||
|
||
|
||
$((function() { | ||
|
||
$(window).scroll(function() { // biography fix when scrolling up | ||
console.log($('html').offset().top); | ||
if ( $('html').offset().top == 0 ) { | ||
$('#navbar').find('.current').removeClass('current'); | ||
$('#navbar ul li a[href^="#bio"]').addClass('current'); | ||
} | ||
}); | ||
|
||
|
||
// var gOffset = 0; | ||
|
||
|
||
$('section').waypoint(function(event, direction) { | ||
|
||
var id = $(this).attr('id'); | ||
//console.log('id: '+$(this).attr('id')+', direction: '+direction); | ||
$('#navbar').find('.current').removeClass('current'); | ||
$('#navbar ul li a[href="#'+id+'"]').addClass('current'); | ||
|
||
// console.log('id: '+$(this).attr('id')+', direction: '+direction); | ||
// gOffset = direction === 'down' ? 160 : 0; | ||
// $.waypoints('refresh'); | ||
|
||
// console.log(gOffset); | ||
//console.log($('html').offset().top); | ||
|
||
}, { | ||
offset: 160 | ||
}); | ||
|
||
|
||
|
||
/* | ||
$(document).scrollTop(0); // quick reset in case user refreshes the page | ||
var OFFSET = 30; | ||
var HEADER_HEIGHT = parseInt($('#header').height()) + OFFSET; | ||
$('a[href^=#]:not([href=#])').click(function(e){ | ||
$('html, body') | ||
.animate({ | ||
scrollTop: $($(this).attr("href")) | ||
.offset().top - HEADER_HEIGHT }, 1200) | ||
.animate({ | ||
scrollTop: $($(this).attr("href")) | ||
.offset().top - HEADER_HEIGHT - 20 }, 300) | ||
.animate({ | ||
scrollTop: $($(this).attr("href")) | ||
.offset().top - HEADER_HEIGHT }, 600); | ||
e.preventDefault(); | ||
}); | ||
*/ | ||
|
||
}); |