Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8816251
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:34:41+00:00 2026-06-14T04:34:41+00:00

Here is a jsFiddle with my code As you can see, the height of

  • 0

Here is a jsFiddle with my code

As you can see, the height of the text area is returned perfectly. But this is becuase the text area is not in font-face mode.

On my site, the text is font-face generated, but it’s getting the height before font-face has loaded, because once you hover the div once and the second iteration runs, it returns the correct height.

So the jQuery height is working, but only once the site has fully loaded the font-face.

Is there a work around this?

Thanks for any pointers.

SIMPLE MARKUP

<div class="home-mod">    
    <div class="mod-center"><img ... /></div>    
    <div class="mod-info"> <!-- this is the slider, slides up when .mod-info is hovered -->                    
        <a class="mod-link" href="..." title="test">DYNAMIC FONT-FACE TEXT HERE</a>

        <div class="mod-excerpt">                        
            DYNAMIC NORMAL TEXT HERE                            
        </div>            
    </div>                           
</div>

CURRENT SCRIPT – FULLY WORKING PERFECT, WHEN TEXT IS NOT FONT-FACE

$(function() {
    // positioning the current div.mod-info inside current div.home-mod

    $(".home-mod").each(function() { 
        // this finds the div.mod-link height, and assigns var to div.mod-info top position
        var moduleLink = $(this).find(".mod-link").height(),
        modulePlus = moduleLink+20;

        $(this).find('.mod-info').css("top", "-" + modulePlus + "px");
    });        

    // animating current div.mod-info to new top position

    $("div.mod-info").hover(function() {
        // first iteration
        // getting dynamic overall height of div.mod-info and animate to 

        var moduleInfo = $(this).height();

        // this then animates to new position 
        $(this).animate({ top: "-" + moduleInfo + "px" });        
    }, function() {
        // second iteration
        // returns back to original postion

        var moduleLink = $(this).find(".mod-link").height(),
        modulePlus = moduleLink+20;

        $(this).animate({ top: "-" + modulePlus + "px" });        
    });

    // this justs finds the link and in .home-mod and make its clickable        
    $(".home-mod").click(function() {            
        window.location = $(this).find("a.mod-link").attr("href");
        return false;            
    });                    
});

UPDATE – SOLVED

Instead of document ready, this worked for me. Slight lag on load but better than incorrect values.

$(window).load(function(){  

    // my script here...

}); 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T04:34:42+00:00Added an answer on June 14, 2026 at 4:34 am

    Yes.

    1. Simplest workaround – set line-height of text (where you want to get height) in pixels. If width of letters in fonts are similar – it will work.

    2. Create 2 hidden (not through display:none, use position:absolute + top:-5000px;) divs with text + white-space:nowrap. For example 1st with monospace, 2nd with your_font,monospace font-family. Then create setInterval (50ms delay is normal) with comparison of their heights.
      When heights become different – your font is loaded and you need to clearInterval.

    3. Longest way – use $(window).load

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a fairly weird case, you can see the code here: http://jsfiddle.net/zpZtH/2/
Here is the code relevant to my question: http://jsfiddle.net/mkerny45/V23NK/ As you can see there
jsfiddle is here: http://jsfiddle.net/M86nA/ code is this: $('div.wrap').click(function(){ var $minY = $('div.imgur-wrap').height(); if ($minY
this example that I can see the attribute . jsFiddle code work well polygon.hoverable
Here you can see the code: http://jsfiddle.net/LQSK3/1/ I can't get display: inline; working there
Here is a jsfiddle where you can see the following code in action. I
Here is my code http://jsfiddle.net/AB6J3/7/ you can see, edit, etc. When I roll over
I have a toggle in jquery and you can see it here: http://jsfiddle.net/Rua4j/ I
I finally got some parts working here: http://jsfiddle.net/trXBr/5/ but when I put the code
Code works perfectly in other browsers but not in IE7. Problem in IE7 is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.