Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Jun 23rd, 2013  |  syntax: None  |  size: 0.51 KB  |  views: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <ul>
  2.     <li>1</li>
  3.     <li>2</li>
  4.     <li>3</li>
  5.     <li>4</li>
  6.     <li>5</li>
  7.     <li>6</li>
  8.     <li>7</li>
  9.     <li>8</li>
  10.     <li>9</li>
  11.     <li>10</li>
  12. </ul>
  13.        
  14. <ul>
  15.     <li class="first-half">1</li>
  16.     <li class="first-half">2</li>
  17.     <li class="first-half">3</li>
  18.     <li class="first-half">4</li>
  19.     <li class="first-half">5</li>
  20.     <li>6</li>
  21.     <li>7</li>
  22.     <li>8</li>
  23.     <li>9</li>
  24.     <li>10</li>
  25. </ul>
  26.        
  27. var $lis = $("ul li");
  28. $lis.slice(0, Math.floor($lis.length/2)).addClass("first-half");
clone this paste RAW Paste Data