Skip to content

Instantly share code, notes, and snippets.

Last active November 6, 2016 02:17
What would you like to do?
Example of Javascript for card component
(function ($) {
'use strict';
Drupal.behaviors.card = {
attach: function (context, settings) {
var $bioButton = $('.card__view-bio', context);
var $bioDrawer = $('.card__bio', context);
var showBio = 'View full biography';
var hideBio = 'Hide biography';
$bioButton.on('click', function() {
if ($bioDrawer.hasClass('is-open')) {
else {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment