Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Work Page - Smooth Filtering
- jQuery(document).ready(function(){
- var $container = jQuery('.work_items');
- $container.isotope({
- itemSelector : '.work_item'
- });
- var $optionSets = jQuery('#work_nav .work_tags_nav'),
- $optionLinks = $optionSets.find('a');
- $optionLinks.click(function(){
- var $this = jQuery(this);
- // don't proceed if already selected
- if ( $this.hasClass('selected') ) {
- return false;
- }
- var $optionSet = $this.parents('.work_tags_nav');
- $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
- $container.isotope( options );
- }
- return false;
- });
- // Call infinite scroll
- $container.infinitescroll({
- navSelector : '#page_nav', // selector for the paged navigation
- nextSelector : '#page_nav a', // selector for the NEXT link (to page 2)
- itemSelector : '.work_item', // selector for all items you'll retrieve
- loading: {
- finishedMsg: 'No projects to load.',
- img: 'http://graphicd-signs.com/main/wp-content/uploads/2013/06/ajax-loader.gif'
- }
- },
- // call Isotope as a callback
- function( newElements ) {
- $container.isotope( 'appended', jQuery( newElements ) );
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement