sync height harmony - Free Download Auto Sync the Heights Of Matched Elements - Height Harmony

Free Download Auto Sync the Heights Of Matched Elements – Height Harmony

Posted on

This time I will share jQuery Plugin and tutorial about Auto Sync the Heights Of Matched Elements – Height Harmony, hope it will help you in programming stack.

sync height harmony - Free Download Auto Sync the Heights Of Matched Elements - Height Harmony
File Size: 15.6 KB
Views Total: 341
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Height Harmony is a minimal jQuery equal height plugin which automatically synchronizes the height of given elements with the same selector.

How to use it:

1. To get started, insert the minifier version of the Height Harmony plugin after loading jQuery JavaScript library.

1 <script src="/path/to/jquery.min.js"></script>
2 <script src="/path/to/height-harmony-min.js"></script>

2. Apply the heightHarmony function to the target elements and done.

01 <div class="block-one">
02   <div class="block-two">Content 1</div>
03   <div class="block-three">Content 1</div>
04 </div>
05  
06 <div class="block-one">
07   <div class="block-two">Content 2</div>
08   <div class="block-three">Content 2</div>
09 </div>
10  
11 <div class="block-one">
12   <div class="block-two">Content 3</div>
13   <div class="block-three">Content 3</div>
14 </div>
15  
16 ...
1 $(document).ready(function(){
2   heightHarmony('.block-one');
3   heightHarmony('.block-two');
4   heightHarmony('.block-three');
5   // ...
6 });

3. Re-init the plugin on window resize. Useful for responsive web design.

1 $(window).resize( function(){
2   heightHarmony('.block-one');
3   heightHarmony('.block-two');
4   heightHarmony('.block-three');
5   // ...
6 });

This awesome jQuery plugin is developed by byronjohnson. For more Advanced Usages, please check the demo page or visit the official website.

source : jquery.net