user3396867
user3396867

Reputation: 109

automaically change div height with other

I have a div in my site named offers which has auto height . I have another div called promotions. I want to make a way that if I increase the height of the first div the second div will automatically change the height according to the first div. How can I do that? thanks

<div class="offers">


</div>


<div class="promotions">


</div>

Upvotes: 0

Views: 39

Answers (1)

Vitorino fernandes
Vitorino fernandes

Reputation: 15951

demo - http://jsfiddle.net/victor_007/ma51tap3/

var a = $('.offers').height()

_increase the height of the first div the second div will automatically change the height _

to check the sibling

$('.offers').siblings('.promotions').height(a)

OR to check the next

$('.offers').next('.promotions').height(a)

Upvotes: 1

Related Questions