Mario LIPCIK
Mario LIPCIK

Reputation: 477

jQuery animate height in different class

Is it possible to have height of animate in different class as is in my case ".bar1"???

$('.bar1').animate({'height':'58%'},1000);

Just to get idea what I mean: '.bar_graf'

$('.bar1').animate({'.bar_graf'.'height':'58%'},1000);

Upvotes: 0

Views: 50

Answers (1)

Zoltan Toth
Zoltan Toth

Reputation: 47677

<div>-s inside of <strong>-s are invalid, so need to fix that

<div class="graph">
    <strong class="bar1"></strong>
    <div class="tooltip">18%</div>
</div> 

Then the tooltip becomes relatively positioned to .graph and we can adjust its' vertical position:

var my = event.pageY - 100;

And the result - http://jsfiddle.net/Dun7q/17/

Upvotes: 1

Related Questions