Parent CSS (jQuery)
- by Glister
There is <dl> with padding-top
<dl style="padding-top: 150px;">
<dt>text</dt>
<dd><img width="150" height="150" src="..." /></dd>
<dt>text 2</dt>
<dd><img width="150" height="250" src="..." /></dd>
<dt>text 3</dt>
<dd><img width="150" height="350" src="..." /></dd>
</dl>
The difference between images - height.
Trying to write a script, which will change a height of the <dl>, when <dd> is clicked.
Height should be taken from the height attribute of the dd img.
Tryed this, but it doesn't work:
$("#posters dd").click(function(){
var parent_padding = $(this).find("img").attr("height");
$(this).parent().css({"padding-top":parent_padding});
});
Thanks.