html - Make DIV bigger if scrolled -



html - Make DIV bigger if scrolled -

is possible create div bigger when content of page scrolled? have chatbox position:fixed on right side of page. css chat box height:100% right:0 bottom:0 top:50px. top:50px because don't want hide navigation bar on top of page. problem is, when start scrolling page, navigation bar disappear sight , there 50px high blank space on top of chatbox. want when start scrolling page, chatbox should take whole 100% of screen, there no blank space on top of it.

you may this:

$(document).ready(function () { $(window).scroll(function () { if ($(this).scrolltop() > 100) { $('.chat_box').css({top:'0px'}); } else { $('.chat_box').css({top:'10px'}); } }); });

http://jsfiddle.net/5tnygmrz/1/

html css height

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -