In my webpage a division in the left hand side should be fixed in a particular position.I am using position:fixed;top:150px;left:0px;
. So now even we scrolldown the page the division will not change from the current position.
But here i am facing a problem. If am scrolling down the page 150px or more
i am getting the white space of 150px
at the top of that left hand side division.
So what my requirement is if am scrolling down the page 150px or more
then the css of that left hand side division should be changed to position:fixed;top:0px;left:0px;
and as well as when i am going to top of the page again the css should change to position:fixed;top:150px;left:0px
;
I came to know that this can't be done with only CSS and we have to use JS along with the CSS. But i don't know how to do that.
Please help me...!!
Thanks in advance, Sreeram