Created
January 4, 2017 19:24
-
-
Save hellofromtonya/c4545a607d1322ec4f366c4c119c54af to your computer and use it in GitHub Desktop.
Basic Collapsible Content jQuery Script Structure
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
;(function($, window, document, undefined){ | |
'use strict'; | |
var $qaQuestions, $qaAnswers, $qaIcons, | |
$teaserMessages, $teaserHiddenContents, $teaserIcons; | |
var init = function() { | |
$qaQuestions = $('.qa--question'); | |
$qaAnswers = $qaQuestions.next(); | |
$qaIcons = $qaQuestions.find('.qa--icon'); | |
$qaQuestions.on('click', {contentType: 'qa'}, clickHandler); | |
$teaserMessages = $('.teaser--visible-message'); | |
$teaserHiddenContents = $teaserMessages.next(); | |
$teaserIcons = $teaserMessages.find('.teaser--icon'); | |
$teaserMessages.on('click', {contentType: 'teaser'}, clickHandler); | |
} | |
var clickHandler = function( event ) { | |
console.log( event ); | |
} | |
function changeIcon() { | |
} | |
function getIndex() { | |
} | |
function getHiddenContent() { | |
} | |
function getIcon() { | |
} | |
function getIconClasses() { | |
} | |
$(document).ready(function(){ | |
init(); | |
}); | |
})(jQuery, window, document); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment