Skip to content

A jQuery plugin dedicated to apply an equal height (the larger one) on a group of elements if they have the same offset top value

License

Notifications You must be signed in to change notification settings

kevinmeunier/jquery-serialflex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jQuery serialflex - Equal height elements

About jQuery serialflex

This plugin adds the same height (maximum) to all elligible elements if they have the same offset top value. Basically, it offers the same feature as a display:flex, this is why the use of this plugin should be avoided as much as possible, however, in some (very few) specific cases, a JavaScript option can mandatory. Note that jQuery serialflex is shared for inspirational and development purpose.

Demonstration

See the project page for a demonstration.

Compatibility

jQuery serialflex has been tested in: IE, Edge, Chrome (mobile included), Firefox (mobile included), and Safari (mobile included).

Self-Hosted

Download and save one of two available files to include serialflex to your page, either the development or the minified version. Also, you can visit the project page to copy what you need.

<script src="jquery.serialflex.min.js"></script>

Make sure jQuery is properly loaded before using jQuery serialflex.

Basic Usage

The basic usage of serialflex is pretty easy, just start using jQuery serialflex by calling it after page load. It works form radio, checkbox, and select. A custom name inside the attribute "data-serialflex" is needed to create the group of elements.

<ul>
  <li><p data-serialflex="customname">Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p></li>
  <li><p data-serialflex="customname">Sit amet consectetur adipiscing elit.</p></li>
  <li><p data-serialflex="customname">Cras porta finibus ullamcorper pellentesque ut purus purus nam convallis dapibus ullamcorper.</p></li>
  <li><p data-serialflex="customname">Ipsum dolor sit amet.</p></li>
  <li><p data-serialflex="customname">Lorem ipsum dolor sit amet consectetur adipiscing elitras porta finibus ullamcentesque ut purus convallis dapibus ullamcorper.</p></li>
  <li><p data-serialflex="customname">Porta finibus ullamcentesque ut purus convallis dapibus ullamcorper</p></li>
</ul>
$(document).ready(function(){
  // jquery.serialflex initialisation
  $('[data-serialflex]').serialflex();
});

Configuration Parameters

The following configurations is available by default:

Name Type Default Description
forceRefresh string false Force the refresh every 50ms instead of on resize

The manual refresh of the plugin can be trigger with this external function below.

$.serialflex.refresh();

Bugs / Feature request

Please report bugs and feel free to ask for new features directly on GitHub.

License

jQuery serialflex is licensed under MIT license.

About

A jQuery plugin dedicated to apply an equal height (the larger one) on a group of elements if they have the same offset top value

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages