2

I wrote small news ticker - http://jsfiddle.net/MrTest/SvFRs/

Problem which I have is that - there is content straigt after news div and I need to know the height of the heighest element in that div (and set this height to the div(parent) ), so I would avoid movement of element underneath it.

Please see my example - http://jsfiddle.net/MrTest/SvFRs/

Any help much appreciated.

Pete

Community
  • 1
  • 1
Iladarsda
  • 10,640
  • 39
  • 106
  • 170

2 Answers2

5

You can get the max height using

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

And set it to the div

$(".noticeboard").height(max);
Dogbert
  • 212,659
  • 41
  • 396
  • 397
  • this looks good but i get this error: Uncaught TypeError: Function.prototype.apply: Arguments list has wrong type – clankill3r Jan 15 '12 at 20:36
3

look this jsFiddle:

http://jsfiddle.net/NqGL9/

i made the background gray to see if it works

Fender
  • 3,055
  • 1
  • 17
  • 25
  • And, once we have that working - how do I make auto scroll + pause on hover? – Iladarsda Jun 28 '11 at 14:08
  • @Pete: If you've got more problems to resolve, post them as new questions rather than tagging them on to the comments of an answer. – Town Jun 28 '11 at 14:12