27102023
This commit is contained in:
33
js/jquery.equalheights.js
Normal file
33
js/jquery.equalheights.js
Normal file
@@ -0,0 +1,33 @@
|
||||
/*!
|
||||
* Simple jQuery Equal Heights
|
||||
*
|
||||
* Copyright (c) 2013 Matt Banks
|
||||
* Dual licensed under the MIT and GPL licenses.
|
||||
* Uses the same license as jQuery, see:
|
||||
* http://docs.jquery.com/License
|
||||
*
|
||||
* @version 1.5.1
|
||||
*/
|
||||
(function($) {
|
||||
|
||||
$.fn.equalHeights = function() {
|
||||
var maxHeight = 0,
|
||||
$this = $(this);
|
||||
|
||||
$this.each( function() {
|
||||
var height = $(this).innerHeight();
|
||||
|
||||
if ( height > maxHeight ) { maxHeight = height; }
|
||||
});
|
||||
|
||||
return $this.css('height', maxHeight);
|
||||
};
|
||||
|
||||
// auto-initialize plugin
|
||||
$('[data-equal]').each(function(){
|
||||
var $this = $(this),
|
||||
target = $this.data('equal');
|
||||
$this.find(target).equalHeights();
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
Reference in New Issue
Block a user