Browse Source

Merge branch 'master' into gh-pages

v1
David DeSandro 13 years ago
parent
commit
b3446eee71
  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; return false;
}); });
var hashChanged = false;
$(window).bind( 'hashchange', function( event ){ $(window).bind( 'hashchange', function( event ){
// get options object from hash // get options object from hash
var hashOptions = window.location.hash ? $.deparam.fragment( window.location.hash, true ) : {}, 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 // apply defaults where no option was specified
options = $.extend( {}, defaultOptions, hashOptions ); options = $.extend( {}, defaultOptions, hashOptions, { animationEngine: aniEngine } );
// apply options from hash // apply options from hash
$container.isotope( options ); $container.isotope( options );
// save options // save options
@ -172,6 +175,7 @@ category: demos
} }
isOptionLinkClicked = false; isOptionLinkClicked = false;
hashChanged = true;
}) })
// trigger hashchange to capture any hash data on init // trigger hashchange to capture any hash data on init
.trigger('hashchange'); .trigger('hashchange');

Loading…
Cancel
Save