To align the height of the trumbnail and its contents, the following script is implemented:
function adjustThumbnailHeight() { var heights = [] var infoblock = [] jQuery('.thumbnail').each(function() { heights.push( jQuery(this).height() ) }) jQuery('.can_resize').each(function() { infoblock.push( jQuery(this).height() ) }) var infoblockOne = infoblock.splice(0, 2) var infoblockTwo = infoblock var heightsOne = heights.splice(0, 2) var heightsTwo = heights var maxOne = Math.max.apply(null, heightsOne) var maxTwo = Math.max.apply(null, heightsTwo) var maxInfoOne = Math.max.apply(null, infoblockOne) var maxInfoTwo = Math.max.apply(null, infoblockTwo) jQuery('.thumbnail:eq('+ 0 + ')').height(maxOne) jQuery('.thumbnail:eq('+ 1 + ')').height(maxOne) jQuery('.thumbnail:eq('+ 2 + ')').height(maxTwo) jQuery('.thumbnail:eq('+ 3 + ')').height(maxTwo) jQuery('.thumbnail:eq('+ 4 + ')').height(maxTwo) jQuery('.can_resize:eq('+ 0 + ')').height(maxInfoOne) jQuery('.can_resize:eq('+ 1 + ')').height(maxInfoOne) jQuery('.can_resize:eq('+ 2 + ')').height(maxInfoTwo) jQuery('.can_resize:eq('+ 3 + ')').height(maxInfoTwo) jQuery('.can_resize:eq('+ 4 + ')').height(maxInfoTwo) } jQuery(document).ready(function() { jQuery('.thumbnail').imagesLoaded( function() { jQuery(window).resize(function() { adjustThumbnailHeight() }) jQuery(document).ready(adjustThumbnailHeight()) }) }) Figure 1 shows how it should be (it is at boot). 
When the window is can_resize class (see Figure 2)
Can someone tell trumbnail how in such cases correctly implement the algorithm for fixing the size of the trumbnail class with the text position changing. It can help refactor the existing algorithm. Thank.
