我想要使用jquery獲取.more類和.popovercontent div的寬度和高度。 popover-content類的寬度是動態的,它可以改變,因爲我從我的數據庫中獲取寬度。 Iam由此得到下面的分區。所以我想知道如何使用這個如何在jQuery中訪問此內部的寬度和高度
console.log(this);
得到的寬度和高度它顯示如下的結果
<div id="picture1-more4" class="more more32 ltr-slide bgblack" style="top: 288px; left: 549px; z-index: 1; width: 32px; height: 32px;">
<div class="imgButton imgButtonDrag imgButtonDrag imgButtonDrag imgButtonDrag imgButtonDrag imgButtonDrag imgButtonDrag imgButtonDrag moreblack"></div>
<div class="popover-inner red" style="margin-left:50px;">
<div class="arrow-right3" style="display: inline-block !important; border-left-width: 10px; border-left-style: solid; border-left-color: green; border-top-width: 10px; border-top-style: solid; border-top-color: transparent; border-bottom-width: 10px; border-bottom-style: solid; border-bottom-color: transparent; position: absolute; top: 50%;"></div>
<h4 class="popover-title"><a href="" target="self">Garden</a></h4>
<div class="popover-content" style="width:400px;"><p>To view details about either the Security or Maintenance section, click the heading or the arrow next to the heading to expand or collapse the section. If you dont want to see certain types of messages, you can choose to hide them from view. </p></div>
</div></div>
感謝您的解決方案爲我工作。 –