(function( window, $, undefined ){ $(document).ready(function(){ var $ztVMContainer262 = $('#ztVMContainer262'); var $optionSets = $('#ztVMOptions262 .option-set'), $optionLinks = $optionSets.find('a'); $optionLinks.click(function(){ var $this = $(this); // don't proceed if already selected if ( $this.hasClass('selected') ) { return false; } var $optionSet = $this.parents('.option-set'); $optionSet.find('.selected').removeClass('selected'); $this.addClass('selected'); // make option object dynamically, i.e. { filter: '.my-filter-class' } var options = {}, key = $optionSet.attr('data-option-key'), value = $this.attr('data-option-value'); // parse 'false' as false boolean value = value === 'false' ? false : value; options[ key ] = value; if ( key === 'layoutMode' && typeof changeLayoutMode === 'function' ) { // changes in layout modes need extra logic changeLayoutMode( $this, options ) } else { // otherwise, apply new options $ztVMContainer262.isotope( options ); } return false; }); }); $(window).load(function(){ var $ztVMContainer262 = $('#ztVMContainer262'); $ztVMContainer262.isotope({ itemSelector : '.ztVMElement262' }); }); $(window).bind('orientationchange', function(event) { if (window.orientation==90 || window.orientation==-90) { var $ztVMContainer262 = $('#ztVMContainer262'); setTimeout(function(){ $ztVMContainer262.isotope({ itemSelector : '.ztVMElement262' }).reLayout(); }, 2000); } }); })(window, jQuery);