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

Vertical Align? #11

Closed
tuskore opened this issue Jun 25, 2014 · 3 comments
Closed

Vertical Align? #11

tuskore opened this issue Jun 25, 2014 · 3 comments

Comments

@tuskore
Copy link

tuskore commented Jun 25, 2014

No description provided.

@tuskore
Copy link
Author

tuskore commented Jun 25, 2014

Waiting line-height to equal the height changed by match-height to vertical align images.

@liabru
Copy link
Owner

liabru commented Jun 25, 2014

This plugin doesn't handle any vertical alignment, so you'll need to run your own script to do that after you apply it.

@liabru liabru closed this as completed Jun 25, 2014
@MFFoX
Copy link

MFFoX commented Jan 28, 2015

@tuskore if you're still looking for vertical alignment, you can achieve this by using the _afterUpdate callback like so:

$.fn.matchHeight._afterUpdate = function (event, groups) {
    for (var key in groups) {
        var group = groups[key];
        var firstElement = group.elements.first();
        var parent = firstElement.parent('.row.equal-cols'); //or whatever your parent row selector is

        //where .vertical-align is whatever element(s) you're trying to vertically align
        parent.find('.vertical-align').css('line-height', firstElement.height() + 'px'); 
    }
}

Keep in mind though, this will only work for one liners.

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

3 participants