mirror of
https://github.com/Pathduck/gallery3.git
synced 2026-07-14 02:50:13 -04:00
Set .gItem height dynamically based on the tallest item in the grid. Addresses ticket #757
This commit is contained in:
@@ -6,6 +6,18 @@
|
||||
});
|
||||
};
|
||||
|
||||
// Make the height of all items the same as the tallest item within the set
|
||||
$.fn.equal_heights = function() {
|
||||
var tallest_height = 0;
|
||||
$(this).each(function(){
|
||||
if ($(this).height() > tallest_height) {
|
||||
tallest_height = $(this).height();
|
||||
}
|
||||
});
|
||||
return $(this).height(tallest_height);
|
||||
};
|
||||
|
||||
|
||||
// Vertically align a block element's content
|
||||
$.fn.gallery_valign = function(container) {
|
||||
return this.each(function(i){
|
||||
|
||||
@@ -449,8 +449,6 @@ form .gError,
|
||||
border: 1px solid #fff;
|
||||
float: left;
|
||||
font-size: .7em;
|
||||
height: 220px;
|
||||
overflow: hidden;
|
||||
padding: .6em 8px;
|
||||
position: relative;
|
||||
text-align: center;
|
||||
|
||||
@@ -59,8 +59,8 @@ $(document).ready(function() {
|
||||
|
||||
// Album view only
|
||||
if ($("#gAlbumGrid").length) {
|
||||
// Vertical align thumbnails/metadata in album grid
|
||||
$(".gItem").gallery_valign();
|
||||
// Set equal height for album items and vertically align thumbnails/metadata
|
||||
$('.gItem').equal_heights().gallery_valign();
|
||||
|
||||
// Initialize thumbnail hover effect
|
||||
$(".gItem").hover(
|
||||
|
||||
Reference in New Issue
Block a user