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

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -