jquery - How to make a sticky ad on sidebar? -


hi website http://cafun.cf have div containing ad @ bottom of sidebar. want slide down when user scrolls till meets footer.

i've tried many solutions using jquery, not working right way (i don't know jquery!)

this structure :

<aside> <!--other divs 'asider' class -->   <div class="asider">      <div id="side_ad">      <!-- ad code-->      </div>   </div> </aside> 

please me this... thanks!


note: want whole 'asider' class slide down.

i think need this

$stick = $('#marker'); jquery(function($) {   function fixdiv() {     var $cache = $('#getfixed');     if ($(window).scrolltop() > $stick.offset().top)       $cache.css({         'position': 'fixed',         'top': '10px'       });     else       $cache.css({         'position': 'relative',         'top': 'auto'       });   }   $(window).scroll(fixdiv);   fixdiv(); }); 

raplace value of $stick = $('#marker'); element trigger fixed element or pixels. in case there plenty of examples fix div on scroll

take @ jsfiddle


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -