Struppi: herausfinden ob Seite ganz nach unten gescrollt

Beitrag lesen

um die Höhe des Dokumentes zu erhalten, benutze ich folgende Funktion, da ist ein workaround drin, den ich irgendwo gefunden habe

  
function getDocSize(w)  
{  
    if(!w) w = window;  
    var s = new Object();  
  
    if (typeof document.height != 'undefined')  
    {  
        s.width =  w.document.width;  
        s.height = w.document.height;  
    }  
    else  
    {  
        var test1 = document.body.scrollHeight;  
        var test2 = document.body.offsetHeight || document.body.clientHeight;  
        if (test1 > test2) // all but Explorer Mac  
        {  
              s.width = document.body.scrollWidth;  
              s.height = document.body.scrollHeight;  
        }  
        else // Explorer Mac;  
             //would also work in Explorer 6 Strict, Mozilla and Safari  
        {  
             s.width = document.body.offsetWidth || document.body.clientWidth;  
             s.height = document.body.offsetHeight || document.body.clientHeight;  
        }  
    }  
    return s;  
}  

Das müßtest du an geeigneter Stelle einbauen.

Struppi.