GithubHelp home page GithubHelp logo

Vertical Align? about jquery-match-height HOT 3 CLOSED

tuskore avatar tuskore commented on July 29, 2024
Vertical Align?

from jquery-match-height.

Comments (3)

tuskore avatar tuskore commented on July 29, 2024

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

from jquery-match-height.

liabru avatar liabru commented on July 29, 2024

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

from jquery-match-height.

MFFoX avatar MFFoX commented on July 29, 2024

@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.

from jquery-match-height.

Related Issues (20)

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.