开发者

How to set a value to another elements height

I have a list of images on my website, and I because of different resolutions on viewers screens, the tot开发者_JAVA技巧al height of the div changes. I need to set the "top" value as the height of ".photoswrap". Thanks for any help.


 $("#something").css("top", $(".photoswrap").css("height"));


I cannot give a working answer with seeing the code, but:

var $someDiv = $('div');
$someDiv.css('top', $('.photoswrap', $someDiv).height());

Or if .photoswrap is not inside of the div specifically:

$('div').css('top', $('.photoswrap').height());
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜