-
-
Save rcmdnk/f916bc985c08c89312b9 to your computer and use it in GitHub Desktop.
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
2 | |
3 | |
4 | |
5 | |
6 | |
7 | |
8 | |
9 | |
10 | |
11 | |
12 | |
13 | |
14 | |
15 | |
16 | |
17 | |
18 | |
19 | |
20 | |
function addSidebarToggler() { | |
if(!$('body').hasClass('sidebar-footer')) { | |
$('#content').append('<span class="toggle-sidebar"></span>'); | |
$('.toggle-sidebar').bind('click', function(e) { | |
e.preventDefault(); | |
$('body').toggleClass('collapse-sidebar'); | |
}); | |
} | |
var sections = $('aside.sidebar > section'); | |
if (sections.length > 1) { | |
sections.each(function(index, section){ | |
if ((sections.length >= 3) && index % 3 === 0) { | |
$(section).addClass("first"); | |
} | |
var count = ((index +1) % 2) ? "odd" : "even"; | |
$(section).addClass(count); | |
}); | |
} | |
if (sections.length >= 3){ $('aside.sidebar').addClass('thirds'); } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment