javascript - jQuery .height() not working with box-sizing: border-border -


i have nav bar have positioned 'fixed' @ top of page. problem have want displace entire page down (dynamic) size of nav depending on size of screen used. basically, want move whole page down height of nav. this, i'm going using padding nav affect it's height. using box-sizing:border-box attribute on nav whenever try , load page, doesn't account height added padding when use jquery's .height() function.

the div 'displacement' class not have except 100% width initially. ugly result along of current code

http://jsbin.com/qomepe/2

can tell me why happening or if i've overlooked something?

try using .outerheight() height of navbar.

from jquery api docs:

"the top , bottom padding , border included in .outerheight() calculation; if includemargin argument set true, margin (top , bottom) included."

http://api.jquery.com/outerheight/


Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -