Skip to content

Commit

Permalink
Navigation: Fire the transition code when we've actually scrolled pas…
Browse files Browse the repository at this point in the history
…t the post
  • Loading branch information
danielbachhuber committed Sep 13, 2012
1 parent 652c9e7 commit d37f784
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions templates/js/flux.js
Expand Up @@ -12,8 +12,10 @@ jQuery( document ).ready( function($) {
var windowTop = jQuery( window ).scrollTop();

$('.post.flux').removeClass('top').each(function() {
var transition_zone = windowTop - ( $(this).height * .8 )
if ( $(this).offset().top > windowTop ) {
var transition_zone = $(this).offset().top + $(this).height();
console.log( $(this).offset() );
console.log( transition_zone + ' ' + windowTop );
if ( transition_zone > windowTop ) {
$(this).addClass('top');
var timestamp = $(this).attr('class').match( /flux-timestamp-([\d]+)/ );
if ( ! $.isArray( timestamp ) )
Expand Down

0 comments on commit d37f784

Please sign in to comment.