开发者

jQuery height() problem

开发者 https://www.devze.com 2022-12-18 07:42 出处:网络
How do we go about accessing a height for a Gridview? The Gridview has a CSS attribute called height that is set to 800px, but I haven\'t been able to acces开发者_如何学JAVAs anything with height()

How do we go about accessing a height for a Gridview? The Gridview has a CSS attribute called height that is set to 800px, but I haven't been able to acces开发者_如何学JAVAs anything with height()

$('ctl00_MainContent_grdPersonResults').height() = null

Any ideas?


When you want to get an element by id you need to prepend a pound sign/hash to use the id selector.

$('#ctl00_MainContent_grdPersonResults').height()...

without it, it will be selecting based on elements having the string as a class name. I'm sure that none of your controls would have that as a class name so the selector is failing. Note that because of the ASP.NET mangles names, though, it may be easier to assign a class name and use the class name selector.


try:

$('ctl00_MainContent_grdPersonResults').innerHeight();

innHeight(): http://docs.jquery.com/CSS/innerHeight

0

精彩评论

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