简体   繁体   English

当浏览器缩放使用javascript更改时,如何检索tr高度?

[英]How to retrieve tr height when the browser zooming changes using javascript?

I am working on a website using ASP.Net and I need to retrieve a table row height using javascript or jquery when the browser zoom changes. 我正在使用ASP.Net的网站上工作,并且当浏览器缩放更改时,需要使用javascript或jquery检索表行高度。 I tried to use $("#idOfTableRow").height(); 我尝试使用$("#idOfTableRow").height(); but it gives me a null value may be because the table exists in the default page and I am writing the jquery code in another page not related to default page. 但是它给我一个空值,可能是因为该表存在于默认页面中,并且我正在将jquery代码写入与默认页面无关的另一个页面中。 Can someone tell me what should I do to retrieve the tr height? 有人可以告诉我该怎么做才能检索tr高度? Thanks!! 谢谢!!

也许在js中,它将在您的默认页面中运行。

 document.getElementById('yourtablerowid').clientHeight

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM