Ciao a tutti,
ho un div che scorre con la pagina usando la proprietà css fixed, il fatto è che ad un certo punto (il termine di un altro div) il div scorrevole dovrebbe fermarsi e non continuare a scorrere
con la pagina.
qualche idea?
thanks
Ciao a tutti,
ho un div che scorre con la pagina usando la proprietà css fixed, il fatto è che ad un certo punto (il termine di un altro div) il div scorrevole dovrebbe fermarsi e non continuare a scorrere
con la pagina.
qualche idea?
thanks
ESEMPIO funzionante.codice:<script type="text/javascript"> var finestra = this; $.fn.followTo = function ( pos ) { var $this = this, $window = $(finestra); $window.scroll(function(e){ if ($window.scrollTop() > pos) { $this.css({ position: 'absolute', top: pos }); } else { $this.css({ position: 'fixed', top: 0 }); } }); }; $('#finestra').followTo(250); <script> <style type="text/css"> #finestra { background:#ace; padding:20px; width:200px; position:fixed; top:0; left:0; } </style> <body> <div id="finestra"> Io ti seguo solo fino ad un certo punto... </div> </body>
![]()
Per una bella risata vai QUI
Cavicchi Andrea
Problemi con javascript, jquery, ajax clicca qui