Anzeige:
Ergebnis 1 bis 3 von 3

Thema: Scrollen?

  1. #1
    Registrierter Benutzer
    Registriert seit
    22.10.2003
    Ort
    Köln
    Beiträge
    23

    Scrollen?

    Hallo,

    Wie kann ich machen, dass meine page automatisch bis ganz unten gescrollt ist, wenn sie geladen ist?

    Danke im vorraus.

    KDSBest

  2. #2
    Registrierter Benutzer Avatar von peschmae
    Registriert seit
    14.03.2002
    Ort
    Schweizland
    Beiträge
    4.549
    schau mal das (mit JavaScript)

    http://selfhtml.teamone.de/javascrip....htm#scroll_by
    Sollte eigentlich das tun.

    (Selfhtml ist sowieso dein Freund )

    Allerdings haben die Samples bei mir nicht funktioniert (Mozilla 1.4) - vielleicht sind die nicht ganz sooo kompatibel wie sie sollten...

    MfG Peschmä
    The greatest trick the Devil ever pulled was convincing the world he didn't exist. -- The Usual Suspects (1995)
    Hey, I feel their pain. It's irritating as hell when people act like they have rights. The great old one (2006)

  3. #3
    Registrierter Benutzer
    Registriert seit
    27.08.2002
    Beiträge
    337
    Probier es mal damit:
    Code:
    <html>
    <head>
    <script language="JavaScript"><!--
    function myHeight() {
        if (document.layers) 
            return document.body.document.height - window.innerHeight;
        else if (document.all)
            return 0; // cannot get current window size
        else
            return 200; // approx height (adjust as necessary)
    }
    
    function myScroll() {
        documentYposition += scrollAmount;
        window.scroll(0,documentYposition);
        if (document.layers) {
            if (documentYposition > documentLength || documentYposition == 0)
                scrollAmount *= -1;
        }
        else if (document.all) {
            if (document.body.scrollTop == lastScrollTop || document.body.scrollTop == 0)
                scrollAmount *= -1;
        }
        setTimeout('myScroll()',scrollInterval);
    }
    
    function start() {
        documentLength = myHeight();
        myScroll();
    }
    
    var documentLength;
    var scrollAmount = 15;          // scroll by 100 pixels each time
    var scrollInterval = 100;       // number of milliseconds between scrolls
    var documentYposition = 0;
    var lastScrollTop = 0;         // workaround for Internet Explorer
    //--></script>
    </head>
    
    <body onLoad="start()">
    
    <div id="body">
    <BR>
    Quousque&nbsp; tandem<BR> abutere,<BR> Catalina, <BR>patientia nostra?<BR>  quam diu etiam<BR>
    furor iste tuus nos eludet? <BR> quem ad finem sese effrenata <BR>iactabit<BR>
    audacia?  Nihilne te nocturnum<BR> praesidium<BR> Palatii, nihil urbis
    vigiliae, nihil <BR>timor populi, nihil <BR>concursus<BR> bonorum omnium, nihil<BR>
    hic munitissimus habendi senatus<BR> locus, &nbsp;nihil horum <BR>ora vultusque
    moverunt? <BR> Patere <BR>tua consilia<BR> non sentis? <BR> constrictam iam horum<BR>
    omnium<BR> scientia teneri <BR>coniurationem tuam non vides?  Quid proxima,<BR>
    quid superiore <BR>nocte egeris, <BR>ubi fueris, quos<BR> convocaveris, quid<BR>
    consilii ceperis,<BR> quem nostrum ignorare <BR>arbitraris?  O tempora, o
    mores!  senatus haec <BR>intellegit,<BR> consul <BR>videt:<BR> hic tamen vivit.
    <BR>
    <BR>
    Nos autem, fortes viri, <BR>satis facere rei publicae videmur,<BR> si istius
    furorem ac tela videmus.
    
    </div>
    
    </body>
    </html>

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •