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 7091975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:15:18+00:00 2026-05-28T08:15:18+00:00

I saw a lot of things on stack overflor to get the highest div,

  • 0

I saw a lot of things on stack overflor to get the highest div, only non of them where working for me. I need to get the height of the div preview_txt.

<div class="headline" data-rating="0.482005543693" onclick="javascript:showArticle(1076);" style="display: none; ">
    <div class="headline_txt">
        <h1>#3726: Meryl Streep schittert in The Iron Lady- alle recensies op een rijtje</h1>
    </div>
    <div class="preview_txt">
        <p>
            De eerste foto's van actrice Meryl Streep als de Britse voormalig premier Margaret Thatcher
            <a href="http://www.guardian.co.uk/film/2011/feb/08/meryl-streep-margaret-thatcher-iron-lady#">
                leidden
            </a>
            vorig jaar al tot een stortvloed aan publiciteit. Nu is
            <a href="http://www.imdb.com/title/tt1007029/">
                <em>The Iron Lady</em>
            </a>
             er dan ook echt. Vanaf vandaag draait de film in de Nederlandse bioscopen. Lees hier alle recensies. 
            <!--more-->
        </p>
    </div>                  
</div>

From the things i saw arround i think i liked this one the most:

var maxHeadLineHeight = Math.max.apply(Math, $("#headline").map(
    function(){
        return $(this).height();
    }
));

console.log("maxHeadLineHeight: "+maxHeadLineHeight);

But that gives me:

Uncaught TypeError: Function.prototype.apply: Arguments list has wrong type

I also tried it like:

"#headline .preview_txt"

while where at it, setting the height for each headline div will be next but that probably won’t be that different (by getting the objects).

  • 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-05-28T08:15:18+00:00Added an answer on May 28, 2026 at 8:15 am

    There are two problems with the code:

    1. Your selector is wrong.

    $("#headline") will find an element with an id of headline, not a class of headline.

    Try this instead:

    $(".headline").map(...
    

    2. You forgot to include .get() after .map()

    I’m not sure why this is important, but examples similar to the code you’ve posted all say you need to call:

    $('<someSelectorHere>').map(function () { /* some mapping code here ... */ })
        .get(); // <-- The part you missed - won't work without it
    

    See this example:

    • https://stackoverflow.com/a/5052710/232593

    Edit:

    According to comments and the jQuery docs, it seems that calling the .get() method is important because the objects returned by jQuery aren’t truly arrays – they just masquerade as arrays. While some browsers are okay with this (seemingly Firefox), other browsers can’t deal with it. So you need to add the .get() to convert to a real array and support those browsers.

    Demo of a working version of the code you provided:

    • http://jsfiddle.net/zvu2n/

    The Javascript from that demo:

    var headlineHeights = $(".headline").map(function() {
        return $(this).height();
    }).get();
    
    var maxHeadLineHeight = Math.max.apply(Math, headlineHeights);
    
    alert("maxHeadLineHeight: " + maxHeadLineHeight);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In interface builder when I add a UITextField I saw a lot of properties
I saw in a lot of AjaxControlToolkit.resources.dll for different languages, even mine (Russian) in
I have read a lot about soft deletes and archive and saw all the
I read a lot of things here on SO and on the web but
I saw and done myself a lot of small products where a same piece
I tried lot of things to delete a locked folder but I was not
Ive been working with CI and I saw on the website of CI you
I've seen a lot of idioms, most of them clever and logical once explained.
During my C# coding experience I saw a lot of pieces of code where
I saw a lot of .properties files in java project. Is this kind of

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.