This repository has been archived by the owner. It is now read-only.
Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
grandchild-entrepreneurship/grandchild-scripts.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
30 lines (26 sloc)
855 Bytes
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
jQuery.noConflict()(function ($) { // this was missing for me | |
$(document).ready(function() { | |
function close_accordion_section() { | |
$('.accordion .accordion-section-title').removeClass('active'); | |
$('.accordion .accordion-section-content').slideUp(300).removeClass('open'); | |
} | |
$('.accordion-section-title').click(function(e) { | |
// Grab current anchor value | |
var currentAttrValue = $(this).attr('href'); | |
if($(e.target).is('.active')) { | |
close_accordion_section(); | |
} | |
else if ($(e.target).is('.active img')) { | |
close_accordion_section(); | |
} | |
else { | |
close_accordion_section(); | |
// Add active class to section title | |
$(this).addClass('active'); | |
// Open up the hidden content panel | |
$('.accordion ' + currentAttrValue).slideDown(300).addClass('open'); | |
} | |
e.preventDefault(); | |
}); | |
}); | |
}); |