Quick Links

Main Navigation

Top

Meteorology

Sign up for the News Update.

Sub Navigation

Top

Home > High School > Academics > Meteorology >

Working...

Ajax Loading Image

 

E-mail Article

Meteorology

February 26, 2013

(function($){ $(function() { $('#byline a').click(function() { var x = window.open(this.href, 'byLine', 'width=650,height=510,scrollbars=1,resizable=1'); x.focus(); return false; }); // Wait until all of the images in the grid are done loading $('.ig-thumbnails').imagesLoaded(function() { $('.ig-thumbnails').each(function() { var $this = $(this), height = 0; // Get the height of the tallest image in the gallery $this.find('img').each(function() { if ($(this).height() > height) height = $(this).height(); }); // Use that to set the height and max-height of the image contaner and image, respectively. $this.find('.thumbnail-inner').css('height', height).end().find('img').css('max-height', height); // Get the combined height of credits and captions height = 0; $this.find('.ig-show-captions-content').each(function() { var $this = $(this), x = 0; x = $this.find('.ig-credit').outerHeight() + $this.find('.ig-caption').outerHeight(); if (x > height) height = x; }); // Cap the height at 100px if (height > 100) height = 100; if (height == 0) { // If there are no captions/credits - hide the checkbox $this.find('> .checkbox').addClass('hidden'); } else { // Set the height when the checkbox is clicked (checkbox acts as a toggle on the height). $this.find('.ig-show-captions').on('click', function() { var $this = $(this); if ($this.is(':checked')) { $this.closest('.ig-thumbnails').find('.ig-show-captions-content').css('height', height + 4); } else { $this.closest('.ig-thumbnails').find('.ig-show-captions-content').css('height', 0); } }); } }); }); }); })(jQuery);

Back To Top