Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // type 3: 2 columns of floated elements, pairs are equal heights
- // and last element stretch to full width if an unmatched pair
- $('.links-with-desc.type-3').each( function() {
- $(this).innerWidth( maxWidth );
- $(this).children().each( function(i) {
- $(this).innerWidth( (maxWidth / 2) ).css('float', 'left');
- if(i == 0 || (i + 1) % 4 == 0 || i % 4 == 0) {
- $(this).css('background', '#161616').css('color', '#ddccdd');
- $(this).find('a').css('color', '#ffeeaa');
- }
- if((i - 1) % 3 == 0)
- $(this).css('background', '#ffeeaa');
- if(i % 2 != 0) { // odd number
- if($(this).prev().height() < $(this).height())
- $(this).prev().height( $(this).height() );
- else if($(this).prev().height() > $(this).height())
- $(this).height( $(this).prev().height() );
- }
- else { // even number (remember index starts with 0!)
- if($(this).hasClass('last'))
- $(this).innerWidth( maxWidth );
- }
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement