Giter Site home page Giter Site logo

jquery-match-height's Introduction

jquery.matchHeight.js

matchHeight makes the height of all selected elements exactly equal

brm.io/jquery-match-height

Demo - Features - Gallery - Install - Usage - Options - Data API
Advanced Usage - Tests - Known limitations - Changelog - License

Demo

See the jquery.matchHeight.js demo.

jquery.matchHeight.js screenshot

Modern browsers

In the years since this library was originally developed there have been updates to CSS that can now achieve equal heights in many situations. If you only need to support modern browsers then consider using CSS Flexbox and CSS Grid instead.

Features

  • match the heights for groups of elements automatically
  • use the maximum height or define a specific target element
  • anywhere on the page and anywhere in the DOM
  • responsive (updates on window resize)
  • row aware (handles floating elements and wrapping)
  • accounts for box-sizing and mixed padding, margin, border values
  • handles images and other media (updates after loading)
  • supports hidden or none-visible elements (e.g. those inside tab controls)
  • throttled to balance performance and smoothness
  • easily removed when needed
  • maintain scroll position
  • data attributes API
  • callback events
  • unit tests
  • module loader support
  • tested in IE8+, Chrome, Firefox, Safari, Android, iOS

Gallery

See how others are using jquery.matchHeight.js

Install

jQuery is required, so include it first. Download jquery.matchHeight.js and include the script in your HTML file:

<script src="jquery.matchHeight.js" type="text/javascript"></script>

You can also install using the package managers Bower and NPM.

bower install matchheight
npm install jquery-match-height

Usage

$(function() {
	$('.item').matchHeight(options);
});

Where options is an optional parameter.
See below for a description of the available options and defaults.

The above example will set all selected elements with the class item to the height of the tallest.
If the items are on multiple rows, the items of each row will be set to the tallest of that row (see byRow option).

Call this on the DOM ready event (the plugin will automatically update on window load).
See the included test.html for many working examples.

Also see the Data API below for a simple, alternative inline usage.

Options

The default options are:

{
    byRow: true,
    property: 'height',
    target: null,
    remove: false
}

Where:

  • byRow is true or false to enable row detection
  • property is the CSS property name to set (e.g. 'height' or 'min-height')
  • target is an optional element to use instead of the element with maximum height
  • remove is true or false to remove previous bindings instead of applying new ones

Data API

Use the data attribute data-mh="group-name" where group-name is an arbitrary string to identify which elements should be considered as a group.

<div data-mh="my-group">My text</div>
<div data-mh="my-group">Some other text</div>
<div data-mh="my-other-group">Even more text</div>
<div data-mh="my-other-group">The last bit of text</div>

All elements with the same group name will be set to the same height when the page is loaded, regardless of their position in the DOM, without any extra code required.

Note that byRow will be enabled when using the data API, if you don't want this (or require other options) then use the alternative method above.

Advanced Usage

There are some additional functions and properties you should know about:

Manually trigger an update

$.fn.matchHeight._update()

If you need to manually trigger an update of all currently set groups, for example if you've modified some content.

Row detection

You can toggle row detection by setting the byRow option, which defaults to true.
It's also possible to use the row detection function at any time:

$.fn.matchHeight._rows($('.item'));

Which will return an array of element selections for each row, see this thread for more information and an example.

Remove bindings

$('.item').matchHeight({ remove: true });

This will remove all bindings for the selected elements, from all groups.

Custom target element

$(function() {
	$('.item').matchHeight({
        target: $('.sidebar')
    });
});

Will set all selected elements to the height of the first item with class sidebar.

Custom property

$('.item').matchHeight({ property: 'min-height' });

This will set the min-height property instead of the height property.

Callback events

Since matchHeight automatically handles updating the layout after certain window events, you can supply functions as global callbacks if you need to be notified:

$.fn.matchHeight._beforeUpdate = function(event, groups) {
    // do something before any updates are applied
}

$.fn.matchHeight._afterUpdate = function(event, groups) {
    // do something after all updates are applied
}

Where event a jQuery event object (e.g. load, resize, orientationchange) and groups is a reference to $.fn.matchHeight._groups (see below).

Manually apply match height

$.fn.matchHeight._apply(elements, options)

Use the apply function directly if you wish to avoid the automatic update functionality.

Throttling resize updates

$.fn.matchHeight._throttle = 80;

By default, the _update method is throttled to execute at a maximum rate of once every 80ms. Decreasing the above _throttle property will update your layout quicker, appearing smoother during resize, at the expense of performance. If you experience lagging or freezing during resize, you should increase the _throttle property.

Maintain scroll position

$.fn.matchHeight._maintainScroll = true;

Under certain conditions where the size of the page is dynamically changing, such as during resize or when adding new elements, browser bugs cause the page scroll position to change unexpectedly.

If you are observing this behaviour, use the above line to automatically attempt to force scroll position to be maintained (approximately). This is a global setting and by default it is false.

Accessing current group bindings

$.fn.matchHeight._groups

The array that contains all element groups that have had matchHeight applied. Used internally for automatically updating on resize events, but you may modify this array if you need to manually access any groups (e.g. if you're deleting elements).

Tests

Open test/page/test.html in your browser to run unit tests via the jasmine test runner.

If you wish to contribute functionality to this project, you are encouraged to add new tests following the same conventions.

Run gulp test to run unit tests on multiple browsers and multiple resolutions, automatically through selenium.

Run gulp test:cloud to test on even more browsers via a cloud service (you will need to create a file called test/conf/private.conf.js with your cloud credentials that looks like this:

exports.config = {
    user: 'username',
    key: 'key'
};

Cloud browser testing for this project is provided by BrowserStack (which is free for open source).

Known limitations

CSS transitions and animations are not supported

You should ensure that there are no transitions or other animations that will delay the height changes of the elements you are matching, including any transition: all rules. Otherwise the plugin will produce unexpected results, as animations can't be accounted for.

Delayed webfonts may cause incorrect height

Some browsers do not wait for webfonts to load before firing the window load event, so if the font loads too slowly the plugin may produce unexpected results.

If this is a problem, you should call _update once your font has loaded by using something like the webfontloader script.

Content changes require a manual update

If you change the content inside an element that has had matchHeight applied, then you must manually call $.fn.matchHeight._update() afterwards. This will update of all currently set equal heights groups.

Also note that previous matchHeight bindings do not apply to new elements, even if they match the selector used. In this case you must remove the old bindings and add new ones, see this comment.

Changelog

To see what's new or changed in the latest version, see the changelog

License

jquery.matchHeight.js is licensed under The MIT License (MIT)
Copyright (c) 2014 Liam Brummitt

This license is also supplied with the release and source code.
As stated in the license, absolutely no warranty is provided.

jquery-match-height's People

Contributors

afelicioni avatar dcorb avatar jonscottclark avatar jorrit avatar julienmelissas avatar kfriend avatar liabru avatar nyordanov avatar robeerob avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jquery-match-height's Issues

Responsive breakpoint issue

Hi,

I'm developing some site and I use your plugin. It's really great and this is the only one that works for me, but I have problem with it in one place. Maybe it's some bug or I do sth wrong.
This is the situation: In one row, there are two blocks (A). In each block there are two blocks (B), in desktop view - one next to second.In tablet view, these inside blocks strething to full width (parent block A), so now they are one above other. The problem is, when resize window, heights doesn't change - it stays this same. But, when I refresh window, everything is OK (in tablet/desktop view), the plugin works well untill change from desktop/tablet view problem appears again.

I use your plugin this way:

$(window).load(function () {
$.fn.matchHeight._apply('.row-blocks', true);
});

and for resize:

var functions;

function functionsResize() {
$.fn.matchHeight._update();
}

$(window).resize(function () {
clearTimeout(functions);
functions = setTimeout(function () { functionsResize(); }, 200);
});

If I use plugin in basic way: $('.block').matchHeight('.row-blocks'); everything works well, but window freezes/lags during resizing.

Sorry for my language mistakes, but I don't write in English a lot. Thanks in advance for any help. ;)

height-issue2

Feature request.....

Hey thanks for making this available. I was pulling my hair out trying to get something to work for like 2 days and then found this. Within a couple of minutes, "bam" it's all working just how I wanted.

I think I saw this somewhere else, but would be nice to have a settable min/max height config.

Like....height (min 300, max 1000)

Thanks again.

Hidden content is not calculated

Hi
First of all, thanks for such an awesome plugin, it works like a charm, I have used it in my project mentioned below and it works perfectly as expected.

However, I have a unique issue, in my project there is a hidden content, and on click of a button (button name is hidden content) we are showing the content inside the div, but when I click on the button only that div is expanding, not the other 2 div, also the parent div classes are not applying due to fixing the height at the initial level.

Below is the link.

http://pacificit.in/visitfree1/overview.html

Kindly check the below image to have a look at initial stage

initial

Below is the image after I click on the hidden content button

error

DIV padding issue

$('.item').matchHeight();
When padding is set:
DIV[1] -> padding: 28px;
DIV[2] -> padding: 38px;
Works properly only when first DIV height is bigger than second DIV.
For example, works wrong when last DIV height is largest.
There is the problem with padding calculation.
There is the problem with the sequence of measurements.

incompatibility with IE8 and media queries.

Hi, I use this plugin to assign the same height to a group of blocks, the whole being responsive. Everything works fine except on IE8. After a few tests, I realize that the matchHeight plugin fails to calculate the height of my elements when their css properties are in a media queries.
In fact, if I delete the media queries, the plugin works well.

Here is the zip with all the test files :
https://dl.dropboxusercontent.com/u/92785077/bug%20matchHeight.zip

How to fix it ?
Thank you.

Destroy method

This is great! Thoughts of adding a destroy method when height matching is no longer needed?

Adjust the height of hidden element

Thank you for this great plugin. Should I question whether it is possible to set the same height for hidden elements. specifically for bootstrap tabs.
Thanks

Equal heights within one row with two boxes in one column

First, thank you very much for your plugin! It helped me a lot.

But I have one problem which I already solved, but I do not know if there is a chance to use your library in a better way.

I use Twitter's Bootstrap 3 with a 1-, 2- or 3-column layout dependent on the viewport. I have three bigger boxes and three smaller ones, all with dynamic content and dynamic font sizes. It should be responsive / fluid and so I do not limit the height or width of the boxes.

Here is an image how it should be (1-column is no problem):
Image of 2- and 3-column layout

With your plugin, 1-column and 3-column layout works fine. The problem is the 2-column layout, because I want to align the boxes 4 and 5 to box 3. So if box 3 is larger than box 4+5+margin, box 4 and 5 should be stretched both in height. If box 4+5+margin is higher, box 3 will be stretched, so it will fit perfectly.

Here you can see my JSFiddle.
Maybe you know how to improve it based on your plugin?

border styles not removed in IE8

hey there. first off, i love the script. the row aware feature is amazing especially for responsive sites.

i am having a strange issue however. in IE8 i am getting the following inline styles on my matchHeight elements.

border-top: medium none;
border-bottom: medium none;

it seems .css("border-bottom",""); is not doing its job in IE8 for some reason. I will look into it, but just wanted to let you know.

Overflow issue, only dissapears after page refresh

Hi,

I'm using the matchHeight.js plugin in my Rails app:

http://188.226.157.101/

I've noticed an overflow issue, where text is overflowing it's div borders. Apparently this only appears on mobile screen sizes.

I'm not sure if the error is caused by the Bourbon Neat grid framework or the matchHeight.js plugin.

Anyone else encountered this issue?

my repository is at:

https://github.com/acandael/beautysalonapp2

the matchHeight.js script is implemented at:

https://github.com/acandael/beautysalonapp2/blob/master/app/views/homes/index.html.erb

thanks for your help,

Anthony

iPad rotation

I think the resize doesn't trigger if i rotate my iPad from landscape to portrait.

Any way to use this with tabbed content?

Hi, great plugin, thank you. I'd like to use it with content that is split into a couple of tabs. The content in visible tabs is fine, but the content in hidden tabs (display:none) is set to height:0px. Is there any way around this?

Stacked Group Items Potential Issue Fix

First, fantastic plugin! Kudos!

Something I noticed was that when reducing the screen width to the point where all items in a group were stacked on top of each other (essentially single item rows), the height would continue to be set to whatever the last value was prior to being stacked.

I believe the issue can be fixed by changing the code on lines 201-203 from this:
// skip apply to rows with only one item
if (opts.byRow && $row.length <= 1)
return;

To something more like this (I'm sure you'll know a better way to implement this, pardon my crude coding):
// set item height to auto for rows with only one item
if (opts.byRow && $row.length <= 1) {
$(this).css('height','auto');
return;
}

Thanks again, maybe this enhancement can make an already amazing plugin just a teeny bit better.

~Steve

Non Responsive

Hi,

Whenever I respond the browser window to test in smaller screens the height in element.style doesn't reset.

Unfortunately I can't show any examples as I'm under NDA. I couldn't find another way to contact you.

Hidden items are being set to 0 height

We have a mobile experience on a responsive site that shows a header link above a series of story-blocks. The matchHeight script works fine on the responsive page working as planned until the user collapses a row of content. This runs a windowshade action that hides the story blocks. The user can open and close and the story blocks show and hide correctly.

However, if the user closes the row, then changes the viewport size (by dragging a browser window or rotating the device), the matchHeight script runs and sets the height of these items to 0px. The row can not be opened again.

Start state (notice the heights on the article elements)
image

Closed state
image

Change Viewport width (notice the articles are now 0px in height)
image

Open state (since items have 0 height, the row will not open)
image

Height issues with ajax

Hi,

I'm using matchHeight() on a WordPress site, and its working fine on initial render. But I'm using Ajax Load More to load more posts, using jQuery's ajaxComplete() to update the height on loaded posts. It's working fine on the first load, but on the second load the heights are set to high (should be around 300px, gets set to around 500px).

Here is my JS:

    jQuery.noConflict();
    jQuery(document).ready(function($){

        $(function() {
            $('#employees .person').matchHeight();
        });

        $( document ).ajaxComplete(function() {
            $.fn.matchHeight._apply('#employees .person')
            $.fn.matchHeight._maintainScroll = true;
        }); 

    });

And ideas?

Not responsive

I've got this working properly on desktop view, but the height of the elements will not reset responsively. It looks fine on desktop, but when i resize the viewport the height stays the same and doesn't reset to account for the new breakpoint, leaving a lot of extra space at the bottom.

Pass data-mh to line-height

Hi.

Is it possible to pass the calculated height to other style attributes like line height?
(This way it would be peace of cake to vertically align text).

Height Property

Hey there,

Congrats for your plugin! You might consider setting the min-height param and not the height as it will allow more flexibility; just a quick hint :)

Radu

Callback

I'm using match-height in differentent projects and, in one way or another, I always end up with the need of a reliable callback.

Safari: inconsistent height

Hi!
There's some issue with matchHeight plugin on my website in Safari (both Mac&iOS): the height calculated is too small and it varies on multiple page refreshes.
screen shot 2014-07-02 at 16 21 27

screen shot 2014-07-02 at 16 21 56

This is a reference look in Chrome:
screen shot 2014-07-02 at 17 05 15
Unfortunately I can't share URL yet since it's a local dev instance.

Auto height after window resize

On load, this plugin works great, but when I filter using mixitup plugin, things start to break. I assume I need a callback function to re-evaluate the height. The following doesn't work. Otherwise, if this question is for the MixItUp dev, then sorry for the trouble.

$(window).resize(function() {
$.fn.matchHeight._update('.item');
});
$(function(){
$('#mixitup').mixItUp({
  animation: {
    effects: 'fade scale',
    animateResizeTargets: true
  },
  callbacks: {
    onMixEnd: function(){
    $.fn.matchHeight._update('.item');
    }
  }
});
});

display: block

This works really well except if used on an element that utilizes the css "display" attribute. e.g., display: table; Since the display attribute gets overwritten by the javascript, it breaks the design (unless using !important). Perhaps an optional setting variable could be created for the display attribute?

Matching Height but not "centering" via margin, padding etc...

So I see the inline style height being added to the desire elements, and the heights are in fact matching for the elements I selected - awesome!

But, the text is not "centering" it self in the adjusted container - I am also not seeing any attempted changes to the margin, padding or border for either element.

What am I missing?

Thanks in advance, I am sure it is mistake on my end but cannot find anything in the docs.

New Release Candidate

Can we get a new release? I am currently using this via bower (v0.5.2) and I really need access to the callback functions.

There are quite a few bug fixes and features that would be nice to have as well as the callbacks :)

Page jumps up on reloading the elements when using ajax pagination

The page jumps up on reloading the elements when using ajax pagination.
I fixed it by saving the scroll position and reloading it on this part of the code.
Thought it might be usefull.


if (byRow) {
      var scroll = $(window).scrollTop();
      // must first force an arbitrary equal height so floating elements break evenly
      $elements.css({
        'display': 'block',
        'padding-top': '0',
        'padding-bottom': '0',
        'border-top-width': '0',
        'border-bottom-width': '0',
        'height': '100px'
      });

      // get the array of rows (based on element top position)
      rows = _rows($elements);

      // revert the temporary forced style
      $elements.css({
        'display': '',
        'padding-top': '',
        'padding-bottom': '',
        'border-top-width': '',
        'border-bottom-width': '',
        'height': ''
      });
      $(window).scrollTop(scroll);
    }

[0.5.2] matchHeight.js should set Items' `height` to `auto` while resizing to be responsive friendly

Scenario: Take for example the thumbnails component in Bootstrap 3.x. Create a responsive grid (.container-fluid) of thumbnails. Create 4 thumbnails inside a single row. Each thumbnail's content should be of different height, well, at least the first thumbnail on the left. Resize down until a thumbnail goes down onto a new line. It should get stuck at the right end of the first taller thumbnail. That's when I gave your plugin a shot to solve that issue.

Since the maximum height is set on all thumbnails by matchHeight, when the window is being resized that maximum height does not change until a certain amount of time has passed (80ms by default) but a responsive grid such as bootstrap's keeps adapting without any delay and that has two visible downsides:

  1. The actual resizing is less fluid (sluggish) because of the repeated calculations the plugin has to make to update the height of each item. Setting a higher throttling delay doesn't help either because of downside number 2.
  2. When resizing a responsive grid whose content has fixed heights the results are not pretty until the actual resizing ends as is the case with bootstrap's responsive grid system.

Solution:

Set the items' height to auto when a resize event occurs and when the actual resize stops, calculate the max height and set it on every item. You should use underscore's _.debounce function for that. Something like this (snippet from an app I'm developing):

var $win = $(window);
$win.on('load resize orientationchange', _.debounce(resetItemsHeight, 500, true);
$win.on('load resize orientationchange', _.debounce(matchItemsHeight, 500);

I'll make a pull request when I enjoy some free time but right now I'm too busy.

Despite this small issue, great plugin!

Height wrong on older Firefox / jQuery versions

In some companies they don't allow Firefox to automatically update. I have a client who is stuck on FF 27 because of this and the height is not calculated correctly when box-sizing is used.
See http://caniuse.com/#search=box-sizing

This can be fixed by changing:

if ($that.css('box-sizing') !== 'border-box') {

into:

if ($that.css('box-sizing') !== 'border-box' && $that.css('-moz-box-sizing') !== 'border-box') {

I know this is something that shouldn't really be fixed (companies need to update), but I thought I'd post it here for people with a similar problem.

Inline Display Styles Removed

I'm having an issue with matchHeight removing the inline style display:none from any parent that contains the element that matchHeight is called on. This happens upon load and resize of the page.

I am using matchHeight on a tabbed page where content is initially shown or hidden using javascript. The issue is that I am using javascript to add inline CSS to hide content, which is where the issue occurs.

The work-around that I have found is to apply an additional class to let CSS hide the content, although this is not ideal.

Wordpress

I can't get it to work with Wordpress. Is there something that might be causing a conflict?

Remove on Small Screens

Hi,

Fantastic plug-in, thanks for this!

I am not very well-versed with jQuery or JS, so wanted to know how to disable/remove the matching heights, if the page is viewed on small screens (phones, tablets) or when window is made narrow by the user.

Alternative throttling

Ive noticed the performance of this plugin can effect page rendering performace when used heavily on a page. I have a scenario where there could be up to 300 resizes on a given page. Ive increased the throttling value but also added a check around the height setter.

My assumption is that DOM manipulations are expensive and that i only need to manipulate the height of an element if its not already the height i want it to be. So i have added this check around the setter.

if (_parse($that.css('height')) !== maxHeight - verticalPadding) {
    $that.css('height', maxHeight - verticalPadding);
}

thoughts?

Issue with row detection

I have experienced a strange issue while setting this up. I made a jsfiddle and while I was trying to extract it I figured out a workaround to it but its not going to solve my problem in the medium term.

The issue is that when the page first loads all the boxes are the same height; the equal heights works but the row detection isn't working. Upon resizing the browser screen it triggers the row detection and the rows resize correctly.

The fiddle below shows the issue. As I was trying to solve it I added in various things, adding in a separate row for every second item, changing the class names so floats, etc weren't applied, eventually putting in data-mh annotations to the items but nothing solved the problem:

http://jsfiddle.net/rtpHarry/6mudcbuc/9/

It turned out that while I was moving it across I hadn't brought over the startup JS line. Without the JS it correctly deduces the rows:

http://jsfiddle.net/rtpHarry/6mudcbuc/8/

But even without the .row tags or the data-mh it still fails to do row detection until you resize the browser:

http://jsfiddle.net/rtpHarry/6mudcbuc/11/

This has solved my problem for today but I am keen to find a solution to the JS startup method because the ultimate plan is to pull these boxes in via data from a json feed and generate them on the fly so they won't exist when your data attribute auto-startup code runs.

Any thoughts?

Setting top, bottom padding to 0

This part allways sets the top and buttom padding on elements to 0. Commenting the lines out them out fixes this. Am i doing something wrong?

// get rows if using byRow, otherwise assume one row
        if (byRow) {

            // must first force an arbitrary equal height so floating elements break evenly
            $elements.css({
                'display': 'block',
                //'padding-top': '0',
                //'padding-bottom': '0',
                'border-top': '0',
                'border-bottom': '0',
                'height': '100px'
            });

            // get the array of rows (based on element top position)
            rows = _rows($elements);

            // revert the temporary forced style
            $elements.css({
                'display': '',
                //'padding-top': '',
                //'padding-bottom': '',
                'border-top': '',
                'border-bottom': '',
                'height': ''
            });
        }

Plugin breaks on Safari(Windows/Mac) and Chrome(Mac)

The plugin is great! However, there is the slight issue of it breaking for Safari (Windows/Mac) and Chrome(Mac)

This is the way it should look:
functioning

This is what happens when it breaks:

breaking

and this:

breaking 2

It seems like it either doesn't calculate the heights at all, or calculates some of them and negates others.

Safari for Windows 5.1.7.
Chrome for Mac 31.0.1650.63

Any fix would be greatly appreciated!!!

Thanks.

Not row aware in IE8

Hi. I'm using this on a responsive site to achieve rows of aligned blocks. Works great in modern browsers, but it doesn't seem to be row-aware in IE8. I'm using respond.js to handle my media queries. The page finishes loading and the blocks aren't equal heights. If I re-run the function from the console, it only fires if I set byRow to false. Any idea how I can resolve this? Thanks!

Viewport jumping during page resize

Resizing the window causes the viewport to jump up the page.

I assume this is a side effect of the way the heights are calculated, and I'm not sure if there is a way around this, just thought I'd let you know.

Add to package managers

Thanks, this was useful. Would you consider adding it to bower or npm? It would be nice to pull in via a package manager.

Safari resize issue

I uploaded a screen cast.
In the first situation, it works properly. In the second situation (after reload) it does not. I have also noticed that in multiple reloads, it doesn't always calculate the height correctly.

I apologize in advance, Screencast isn't the fastest to load videos.
http://screencast.com/t/ZuynFBfTT8u

Display Table-Cell

Is there any way to have the plugin respect the "table-cell" display option? It's helpful for vertically centering within the columns.

div at bottom of parent div

I'm trying to get a div "float" to the bottom of the containing div.- e.g http://stackoverflow.com/questions/2147303/how-can-i-send-an-inner-div-to-the-bottom-of-its-parent-div
The containing div is the element which is "matchHeighted".

The pseudo-HTML contains:

<div class="content">
  <div class="frontpage-item">
       <div class="floatdown">
   <div class="frontpage-item">
   <div class="frontpage-item">
</div>

CSS

.frontpage-item {
    position: relative;
}
.frontpage-item .floatdown {
    bottom: 0;
    position: absolute;
}

js contains

    $(document).ready(function() {
        $(".frontpage-item").matchHeight(false);

The problem is that as soon as I "apply" position:absolute to the inner-div,- whether by css as above or later on via js/jquery (this is the actual idea), the height of the .frontpage-item div "collapses" to the height on it's content without the inner div.

Clearly position:absolute breaks the flow - but I figured since matchHeight sets the height of the containing div explicitly this would have no effect. Somehow the flow-break bubbles up to this element afterall.

Is there any way to stop this or is there any other technique you know of to have the text of the inner-div aligned to the bottom of the outer div - without causing such a collapse?
(been struggling with this for a couple of hours!)

Avoiding content overflow

Hello,

First of all thanks for the plugin and the detailed instructions on how to use it. I have used it for a primary & secondary section. It works. But in the primary content section I have a Ajax form that adds error message above the form. This results in increase in the height of the #primary div. So the content overflows.
I'm not sure if I have explained it well, but in case you did understand is there any way to avoid such issues?

height calculating not working properly

Hi,

at first thanks for your great plugin. :) I used it on one page without problem, but on a new layout, I'm having problems with the calculated height. I made a jsfiddle to show the problem.

The last Box is always falling out, because the height is calculated to small:

http://jsfiddle.net/emjay__/xp1g0d0f/

If I add another box to the last row, it is working again. I hope this problem is fixable. :)

Thanks

Hey man, great plugin, got a question

Is there a way to remove the equal height on resize? for mobile browsers, some of my full size equal height elements need to return to their previous automatic height. Is there a "desctruct" method that removes the styles applied by the plugin, or am i going to have to do this myself programmatically with $(window).on('resize, function..

Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.