Skip to content

Instantly share code, notes, and snippets.

@cdracars
Created September 5, 2014 14:23
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 cdracars/b0bc4bdc1b1ff35eed75 to your computer and use it in GitHub Desktop.
Save cdracars/b0bc4bdc1b1ff35eed75 to your computer and use it in GitHub Desktop.
/**
* @file
* A JavaScript file for the theme.
*/
// JavaScript should be made compatible with libraries other than jQuery by
// wrapping it with an "anonymous closure". See:
// - http://drupal.org/node/1446420
// - http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth
(function ($) {
Drupal.behaviors.showhidetext = {
attach: function (context, settings) {
$(".listing-text").addClass('is-hidden');
$(".listing .views-row").hover(
function() {
$(this).find(".listing-text").addClass('is-shown');
}, function() {
$(this).find(".listing-text").addClass('is-hidden').removeClass('is-shown');
}
);
}
}
})(jQuery);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment