Skip to content

Instantly share code, notes, and snippets.

@talentedaamer
Created November 26, 2015 05:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talentedaamer/d35469ba928224c72207 to your computer and use it in GitHub Desktop.
Save talentedaamer/d35469ba928224c72207 to your computer and use it in GitHub Desktop.
custom functions to call JavaScript and jQuery functions and plugins.
/**
* 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