Visualizzazione dei risultati da 1 a 2 su 2

Discussione: Div bottom che scrolla

  1. #1

    Div bottom che scrolla

    Ciao a tutti...
    Non essendo esperto di javascript ho copiato un codice che ho trovato che mi permette di mantenere un div sempre al border top della pagina anche quando scrollo.

    Il punto è che a me non serve che il div sia sempre allineato a top bensì vorrei che fosse sempre allineato a bottom

    Questo è il mio codice:

    <div id="divStayTopLeft" style="position: absolute">Ciao Ciao</div>
    <script type="text/javascript">
    function JSFX_FloatTopLeft()
    {
    startY = 95;
    var ns = (navigator.appName.indexOf("Netscape") != -1);
    var d = document;
    var px = document.layers ? "" : "px";
    function ml(id)
    {
    var el=d.getElementById?d.getElementById(id):d.all?d.a ll[id]:d.layers[id];
    if(d.layers)el.style=el;
    el.sP=function(y){this.style.top=y+px;};
    el.y = startY;
    return el;
    }
    window.stayTopLeft=function()
    {
    var pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop;
    var dY = (pY > startY) ? pY : startY;
    ftlObj.y += (dY - ftlObj.y + 20)/8;
    ftlObj.sP(ftlObj.y);
    setTimeout("stayTopLeft()", 5);
    }
    ftlObj = ml("divStayTopLeft");
    stayTopLeft();
    }
    JSFX_FloatTopLeft();
    </script>

  2. #2

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.