Created
November 26, 2015 05:10
-
-
Save talentedaamer/d35469ba928224c72207 to your computer and use it in GitHub Desktop.
custom functions to call JavaScript and jQuery functions and plugins.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* custom js functions | |
*/ | |
jQuery(function ($) { | |
// filterable properties. | |
var $container = $('.properties'); | |
$container.isotope({ | |
filter: '*', | |
animationOptions: { | |
duration: 750, | |
easing: 'linear', | |
queue: false, | |
} | |
}); | |
$('nav.primary ul a').click(function(){ | |
var selector = $(this).attr('data-filter'); | |
$container.isotope({ | |
filter: selector, | |
animationOptions: { | |
duration: 750, | |
easing: 'linear', | |
queue: false, | |
} | |
}); | |
return false; | |
}); | |
var $optionSets = $('nav.primary ul'), | |
$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('nav.primary ul'); | |
$optionSet.find('.selected').removeClass('selected'); | |
$this.addClass('selected'); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment