Responsive Equal Height Columns using jQuery
How do I make an responsive equal height columns using jquery?
Equal height columns that adjust on resize events and have a specific small-screen behavior.Find the tallest column and apply that value to the rest, on load and resize. Remove height when screen is smaller than x.. What is a responsive equal height columns using jquery? How do you make a responsive equal height columns using jquery? This script and codes were developed by Laura Moraiti on 27 August 2022, Saturday.
Responsive Equal Height Columns using jQuery - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Responsive Equal Height Columns using jQuery</title> <link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,700|Playfair+Display:900' rel='stylesheet' type='text/css'> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/5.0.0/normalize.min.css"> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class="cols"> <div class="col"> <div class="content"> <div class="title"> <h3>Baby title</h3> </div> <div class="details"> <h5>Hello</h5> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> <h5>Hello</h5> <p>Velit iste nemo, nesciunt id officia exercitationem dolorum recusandae at doloribus tempore. Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> </div> </div> <div class="action"><sup>$</sup><strong>500</strong></div> </div> <div class="col"> <div class="content"> <div class="title"> <h3>Short title</h3> </div> <div class="details"> <h5>Hello</h5> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> <h5>Hello</h5> <p>Velit iste nemo, nesciunt id officia exercitationem dolorum recusandae at doloribus tempore.</p> <h5>Hello</h5> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> </div> </div> <div class="action"><sup>$</sup><strong>850</strong></div> </div> <div class="col"> <div class="content"> <div class="title"> <h3>Longer, yet short title</h3> </div> <div class="details"> <h5>Hello</h5> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> <h5>Hello</h5> <p>Velit iste nemo, nesciunt id officia exercitationem dolorum recusandae at doloribus tempore.</p> <h5>Hello</h5> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> <h5>Hello</h5> <p>Velit iste nemo, nesciunt id officia exercitationem dolorum recusandae at doloribus tempore.</p> </div> </div> <div class="action"><sup>$</sup><strong>1000</strong></div> </div> <div class="col"> <div class="content"> <div class="title"> <h3>Longest of them all, like a bad movie</h3> </div> <div class="details"> <h5>Hello</h5> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> <h5>Hello</h5> <p>Velit iste nemo, nesciunt id officia exercitationem dolorum recusandae at doloribus tempore.</p> <h5>Hello</h5> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> <h5>Hello</h5> <p>Velit iste nemo, nesciunt id officia exercitationem dolorum recusandae at doloribus tempore.</p> <h5>Hello</h5> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p> <h5>Hello</h5> <p>Velit iste nemo, nesciunt id officia exercitationem dolorum recusandae at doloribus tempore.</p> </div> </div> <div class="action"><sup>$</sup><strong>1.000.000</strong></div> </div>
</div> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
Responsive Equal Height Columns using jQuery - Script Codes CSS Codes
* { box-sizing: border-box;
}
h3 { font-family: "Playfair Display", serif; font-size: 1.5em; margin-bottom: 1rem; color: #AF9751;
}
h5 { font-family: "Source Sans Pro", sans-serif; font-size: 1em; text-transform: uppercase; margin-bottom: .5rem;
}
.col { float: left; width: 25%;
}
@media (max-width: 800px) { .col { width: 100%; float: none; }
}
.content { padding: 1em; background-color: #fff;
}
.content * { margin-top: 0; text-align: center;
}
.content p { font-family: "Source Sans Pro", sans-serif; font-size: .9em; display: inline-block;
}
.content p:last-of-type { margin-bottom: 0;
}
.action { font-family: "Playfair Display", serif; text-align: center; background-color: black; color: #fff; letter-spacing: 1px; padding: 1em; font-size: 1.15em; cursor: pointer; transition: all .3s ease-in-out;
}
.action sup { color: rgba(255, 255, 255, 0.75);
}
.action strong { font-size: 1.5em;
}
.action:hover { background-color: #AF9751;
}
@media (max-width: 800px) { .hide-empty { display: none; }
}
Responsive Equal Height Columns using jQuery - Script Codes JS Codes
(function(){ var equalH = { config: { elem: ['.content', '.title'], w: 800 }, max: function(map) { var maxVal = Math.max.apply(null, map); return maxVal; }, map: function(ele, inner) { var eleH = $(ele) .map(function() { // On Load: height of the container if(inner !== true) { return $(this).height(); } // On resize: measure and sum up height of children to update height else { var totalHeight = 0; $(this).children().each(function() { totalHeight += $(this).outerHeight(true); }); return totalHeight; } }) .get(); // Returns [a, b, c] clean, with no extra data return eleH; }, apply: function(ele, inner) { var f = equalH, max = f.max, map = f.map, w = f.config.w; if( $(window).width() > w ) { ele.height(max(map(ele, inner))); } else { ele .removeAttr('style') // Hide empty children on responsive view .children(':empty') .parent().addClass('hide-empty'); } }, onResize: function(ele) { var f = equalH; // On load f.apply(ele); // On resize $(window).resize(function(){ f.apply(ele, true); }); }, init: function(config){ $.extend(this.config, config); var f = equalH, elem = f.config.elem; // Loop through multiple elements $.each(elem, function(index, value){ var ele = $(value); f.onResize(ele); }); } }; equalH.init();
})();
![Responsive Equal Height Columns using jQuery - Script Codes](http://shots.codepen.io/Fixie/pen/xbQJvM-512.jpg)
Developer | Laura Moraiti |
Username | Fixie |
Uploaded | August 27, 2022 |
Rating | 3 |
Size | 3,830 Kb |
Views | 32,384 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Poll | 4,419 Kb |
Fluid section title with border on both sides | 1,955 Kb |
Striped background for a container with more than one element | 1,942 Kb |
Simple and clean form | 5,390 Kb |
Responsive three column fixed layout | 3,256 Kb |
Reusable simple dropdown | 1,873 Kb |
Breadcrumb made with jQuery | 3,943 Kb |
Responsive and friendly table | 4,796 Kb |
Horizontal infinite loop newsticker | 2,634 Kb |
Unconventional slideshow | 2,567 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
We Simplify animation | Meodai | 48,169 Kb |
Pictos font library from CodePen | Jstam | 3,790 Kb |
Starfield old school style | Bolloxim | 5,214 Kb |
Part 19 Bootstrap split button dropdown | Venkatesha | 1,601 Kb |
CSS Link Zoom On Click | Bryce | 1,960 Kb |
Scifi-style Interative Form | Aaronchuo | 4,566 Kb |
Kut D3 | Jellevrswk | 3,687 Kb |
Mega Menu by Joni | Asakasinsky | 3,171 Kb |
No Vacancy 404 CSS Only | Sethkontny | 0 Kb |
Animated Logo | Shakdaniel | 2,672 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!