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

Any way to use this with tabbed content? #1

Closed
suprpp opened this issue Mar 28, 2014 · 7 comments
Closed

Any way to use this with tabbed content? #1

suprpp opened this issue Mar 28, 2014 · 7 comments
Labels

Comments

@suprpp
Copy link

suprpp commented Mar 28, 2014

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?

@liabru
Copy link
Owner

liabru commented Mar 28, 2014

I think the issue is you normally can't get correct height of an element if the element is inside another element that is "display:none".

I think you'll either have to apply matchHeight before you apply your tab script,
or make the tab panel display:block then apply matchHeight, then after make the tab panel display:none again immediately after.

If this doesn't help, could you provide a jsFiddle?

Cheers

@liabru
Copy link
Owner

liabru commented Apr 15, 2014

I'm closing this for now, but I'll reopen it if you reply with more info regarding an issue, cheers.

@andyg2
Copy link

andyg2 commented Jun 9, 2014

I have a similar problem
I have tabs in a boorstrap modal window.
I've tried this which doesn't work

$("#ez-layer-settings-modal").css({"display":"block"});
$("#ez-layout-themes-tab").css({"display":"block"});
$(".ez-theme-preview").matchHeight(true);
$("#ez-layout-themes-tab").css({"display":"auto"});
$("#ez-layer-settings-modal").css({"display":"none"});

But this does work however it leaves the modal and tab displaying :(

$("#ez-layer-settings-modal").css({"display":"block"});
$("#ez-layout-themes-tab").css({"display":"block"});
$(".ez-theme-preview").matchHeight(true);

I'm stumped

@liabru
Copy link
Owner

liabru commented Jun 9, 2014

@andyg2 is it not possible to apply matchHeight before you apply your tab script?

@andyg2
Copy link

andyg2 commented Jun 11, 2014

If I apply matchHeight before, all heights are set to 0px
I've managed to work around it with:

$(document).on("click", 'a[data-toggle="tab"]', function (e) {
    if(e.target.text=="tab text"){
        $(".selector").matchHeight(true);
    }
});

@pinin
Copy link

pinin commented Jul 3, 2014

If someone helps - Combine the plugin jquery.actual to determine the height of hidden element
https://github.com/dreamerslab/jquery.actual

@liabru
Copy link
Owner

liabru commented Jul 3, 2014

@pinin thanks, this plugin already integrates a similar technique

@andyg2 @suprpp

From #12:

I've just pushed a change that now automatically handles hidden elements like those in tabs.
I tested it working with Bootstrap tabs.

If you're still having this issue, would you mind giving the latest master version a try?

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

No branches or pull requests

4 participants