javascript - Jquery this.height not working properly -
i setting height of tr dynamically using jquery. code run on document.ready
. debugged code , saw height set coming proper (493
) when assign it, tr
, still showing 3193
while when see $(this)[0].style.height
, shows 493px
. confused how can different.
code -
$(document).ready(function () { var heighttoset = $(window).height(); $('#tr1').height(heighttoset); });
note elements in table big , due this, there no scrollbar.
this
refers document
element in code. want set height of body
element or descendant of body
element.
look @ console jsfiddle, you'll see this
in event handler: http://jsfiddle.net/qwk6x/
update
you can change css of td elements in table not show overflow. setting height it's being ignored because content of element makes lager set height:
css --
td { display : block; overflow : hidden; white-space : nowrap; }
js --
$(function () { $('#tr1').children().height($(window).height()); });
here's demo: http://jsfiddle.net/qwk6x/3/
Comments
Post a Comment