Sync docs from master to gh-pages
This commit is contained in:
@@ -86,7 +86,26 @@ function createSwitchItem(block, blockSwitch) {
|
||||
return {'item': item, 'content': content};
|
||||
}
|
||||
|
||||
function globalSwitch() {
|
||||
$('.switch--item').each(function() {
|
||||
$(this).off('click');
|
||||
$(this).on('click', function() {
|
||||
selectedText = $(this).text()
|
||||
selectedIndex = $(this).index()
|
||||
$(".switch--item").filter(function() { return ($(this).text() === selectedText) }).each(function() {
|
||||
$(this).addClass('selected');
|
||||
$(this).siblings().removeClass('selected');
|
||||
selectedContent = $(this).parent().siblings(".content").eq(selectedIndex)
|
||||
selectedContent.removeClass('hidden');
|
||||
selectedContent.siblings().addClass('hidden');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
$(addBlockSwitches);
|
||||
$(globalSwitch);
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
|
||||
Reference in New Issue
Block a user