Skip to content

Instantly share code, notes, and snippets.

@rocketnova
Created February 16, 2011 01:44
Show Gist options
  • Save rocketnova/828692 to your computer and use it in GitHub Desktop.
Save rocketnova/828692 to your computer and use it in GitHub Desktop.
var columnSort = function() {
// Column counting wrapping thing
var itemCount = $('css declaration to find parent views-row').length;
var column1 = $('<div></div>').appendTo('put it somewhere');
$('css declaration to find parent views-row').each(function(index) {
if (soething to fingure out which column) {
$(this).appendTo(column1); or
$(this).remove().appendTo(column1); or
column1.append(this);
}
});
}
(function ($) {
$(document).ready(function() {
// Listing pages: Display only the first image.
var field_items = $('body.page-views div#content div.item-list div.field-type-image div.field-items');
field_items.each(function(index) {
$(this).children().first().show();
});
// Node pages: Display slideshow.
$('body.page-node div.content div.field-type-image div.field-items').cycle({
pause: 1,
speed: 1000,
timeout: 1000,
next: 'body.page-node div.content div.field-type-image div.field-items',
height: 300
});
});
columnSort();
$(window).resize(function() {
columnSort();
});
})(jQuery);
/// CSS
.js div.view-display-id-page_1 li.views-row-3 div.field_items div.field-item {
display: none;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment