简体   繁体   中英

jquery div height run time issue

Please see the below code

panelHeight = $('.panel:eq(' + x + ')', slider).height();

it returns the height correctly. If the height varies run time it is not returnts the current value.

ie By normal condition i have 2 paragraph of text inside the div. SO the height is 100px. Under onclick, the text will be varied from 2 paragraph to 5 paragraph. At that time the height is 500px. But it shows the height as 100px.

How to get this height.

Please refer this url http://vsoftdemos.com/coda/err.html We used coda slider. Here if you change the Teams: dropdown from 16 to 22 then 'Invite or Remove Owners' section have more data than they previously appear. At that time some of the 'Division Alignment' section content will disappear. We know this is due to height proble. But i dont know how to fix this. Please help.

See also innerHeight() and outerHeight() when you want to include padding / borders / margins.

when rou are running this cript onchage or click or live tell me..please give detail in your problem.. detailed code also.. may be i can help u.

$(selector).height(function(index,oldheight))

Specifies a function that returns the new height of selected elements. index - Optional. Receives the index position of the selector oldheight - Optional. Receives the current height of the selector

If you had passed the height inline in the beginning then this may help. Here I remove the already passed height to the div.

$('div').css('height', '').height();

Demo: http://jsfiddle.net/mKJ9w/

Or in case of css issue, remove overflow:hidden from .coda-slider css class.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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