I wanted to add a side banner, which depending on the scroll, the banner accompanying the page. The image shows what I want to do:
Butthebannercanneverpassafewlimits,thatis,itcannotgooverheader
norfooter
andkeepinginmindthatpagesizeisnotalwaysthesame.CanIlimitthiswithdivs?OrcanIgivealimit,forexample,giveaspaceaboveandbelow?AndhowdoIgetthebannertomoveaccordingtoscroll?
I'vedonethefollowing:
<style>@mediascreenand(max-width:770px){#getFixed{display:none;}}#getFixed{padding:100px0px00px;margin:0px;z-index:2;}</style><script>functionfixDiv(){var$cache=$('#getFixed');if($(window).scrollTop()>350)$cache.css({'position':'fixed','top':'10px'});else$cache.css({'position':'relative','top':'auto'});}$(window).scroll(fixDiv);fixDiv();</script><divid="getFixed" style="margin-top: 35px;">
<img src="<?php echo $banner;?>" width="220">
</div>
The problem is that the image goes up the footer, can I put some limit? What is happening to me is this (the banner is above the footer):