Browse Source

demos : hash history : prevent animation on first call for non-CSS transition browsers. fixes #64

pull/96/head
David DeSandro 13 years ago
parent
commit
d59a16810c
  1. 6
      _posts/demos/2011-06-13-hash-history.html

6
_posts/demos/2011-06-13-hash-history.html

@ -143,12 +143,15 @@ category: demos
return false;
});
var hashChanged = false;
$(window).bind( 'hashchange', function( event ){
// get options object from hash
var hashOptions = window.location.hash ? $.deparam.fragment( window.location.hash, true ) : {},
// do not animate first call
aniEngine = hashChanged ? 'best-available' : 'none',
// apply defaults where no option was specified
options = $.extend( {}, defaultOptions, hashOptions );
options = $.extend( {}, defaultOptions, hashOptions, { animationEngine: aniEngine } );
// apply options from hash
$container.isotope( options );
// save options
@ -172,6 +175,7 @@ category: demos
}
isOptionLinkClicked = false;
hashChanged = true;
})
// trigger hashchange to capture any hash data on init
.trigger('hashchange');

Loading…
Cancel
Save