Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Height Property #30

Closed
raducretu opened this issue Sep 5, 2014 · 17 comments
Closed

Height Property #30

raducretu opened this issue Sep 5, 2014 · 17 comments

Comments

@raducretu
Copy link

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

@liabru
Copy link
Owner

liabru commented Sep 7, 2014

Thanks for the suggestion, but this may actually break the result for some peoples use cases!
It may be something worth adding as an option though, I'll try it out.

The only way it would really work fully is if matchHeight could update automatically when items change size. This would be getting into element query territory though.

@maximelebreton
Copy link

+1

@liabru
Copy link
Owner

liabru commented Sep 10, 2014

Can either of you show me a jsfiddle with a case where you need this ability? Thanks

@raducretu
Copy link
Author

Hi, it's a little hard, to show but i will describe why. If you use it on responsive layouts, then height can create some huge gaps or try to force the content to fit in a smaller box that the content is on mobile. Please let me know if it makes sense.

@smdksu
Copy link

smdksu commented Nov 18, 2014

I also vote for some flexibility and/or updating option. My use case - I'm using this for equal height content and sidebar columns. If I use any sort of collapsable tabs that expand in the content area that will break the layout as the height is set.

@liabru
Copy link
Owner

liabru commented Nov 19, 2014

@smdksu if I add an option to use min-height rather than height, would this solve your issue?

@smdksu
Copy link

smdksu commented Nov 19, 2014

After playing around with some more options my issue seems to be more complicated. Min-height helps the content area that gets expanded but leaves the other columns needed to be resized. In most use cases this is probably fine but since I am using it on a content area and sidebar it doesn't work visually for the sidebar to have a gap.

You can call the resize update function but you have to wait for the content to fully expanded, and if there is any animation to the expansion then there is a big delay before everything lines back up. This is especially jarring on collapse since columns can overlap before resizing.

I'm now thinking that the issue is too complex to have this sort of solution work. Which is fine, the plugin does a great job at what it already does.

@liabru
Copy link
Owner

liabru commented Nov 20, 2014

You can call the resize update function but you have to wait for the content to fully expanded, and if there is any animation to the expansion then there is a big delay before everything lines back up.

Exactly, animation or any kind of dynamic sizing isn't supported by the nature of the plugin sadly.

I'm now thinking that the issue is too complex to have this sort of solution work. Which is fine, the plugin does a great job at what it already does.

This is the conclusion I came to as well when I was looking at this sort of thing, they only really work for very specific use cases.

So unless someone provides a jsfiddle with a good example, I still don't see a concrete need or feature here that can be implemented?

@tomagladiator
Copy link

Hello, I have the situation :)
http://jsfiddle.net/twnevn8k/2/

For this case, an option could be useful.

@liabru
Copy link
Owner

liabru commented Dec 12, 2014

@tomagladiator not sure why you need matchHeight for that?

Either way, just calling $.fn.matchHeight._update(); works fine here.

@tomagladiator
Copy link

Thanks,
@liabru in fact my exemple is too simple.

In reality I have a huge tentacular forms with a lot of animated slideDown.

This fiddle is more closer to my case : http://jsfiddle.net/twnevn8k/3/
(because slideToggle) :)

@liabru
Copy link
Owner

liabru commented Dec 15, 2014

So again, your problem is because of animation? As animation isn't supported...

@tomagladiator
Copy link

indeed. -_-'
Sorry, I just saw this: animation not supported

So, I will add a custom script to change your height to min-height.

@liabru
Copy link
Owner

liabru commented Dec 29, 2014

@kiballion @maximelebreton @smdksu @tomagladiator

I have added support for min-height in the latest master version:
https://github.com/liabru/jquery-match-height/blob/master/jquery.matchHeight.js

Usage is like so:

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

I'm still not certain this will solve the root cause of most of your issues here, but please try it and tell me if you have any success. Thanks.

@Akrion
Copy link

Akrion commented Mar 25, 2015

Hi, I am using the 0.5.2 version and the above fix does not seem to work. Was the min-height released as part of the 0.5.2? Thanks again for your work and for sharing.

@liabru
Copy link
Owner

liabru commented Mar 26, 2015

This feature is currently only in the latest master build so please use that for the time being, thanks.

@Akrion
Copy link

Akrion commented Mar 26, 2015

Thanks. Will do.

Sent from my iPhone

On Mar 26, 2015, at 5:12 PM, Liam notifications@github.com wrote:

This feature is currently only in the latest master build so please use that for the time being, thanks.


Reply to this email directly or view it on GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants