Created
December 24, 2013 00:22
-
-
Save fahdi/8106983 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
<!--[if IE]> | |
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> | |
<![endif]--> | |
<style> | |
article, aside, figure, footer, header, hgroup, | |
menu, nav, section { display: block; } | |
</style> | |
</head> | |
<body> | |
<ul> | |
<li>November 2013</li> | |
<li>October 2013</li> | |
<li>September 2013</li> | |
<li>August 2013</li> | |
<li>July 2013</li> | |
<li>June 2013</li> | |
<li>May 2013</li> | |
<li>April 2013</li> | |
<li>March 2013</li> | |
<li>February 2013</li> | |
<li>January 2013</li> | |
</ul> | |
</body> | |
</html> |
This file contains hidden or 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(function($){ | |
var size = 6, | |
$ul = $("ul"), | |
$lis = $ul.children().filter(':gt(' + (size - 1) + ')'), | |
loop = Math.ceil($lis.length / size), | |
i = 0; | |
$ul.css('float','left').wrap("<div style='overflow: hidden'></div>"); | |
for(; i < loop; i = i + 1){ | |
$ul = $("<ul />").css('float','left').append($lis.slice(i * size, (i * size) + 4)).insertAfter($ul); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment