Gr@smaaier
Gebruiker
- Lid geworden
- 16 jun 2004
- Berichten
- 418
Als ik de voorgaande text als code invoer in Html krijg ik een button die als je er op klikt de hele pagina naar beneden scrolt. Is er ook een manier om via de button naar een bepaald stuk van de pagina te gaan via deze scroll techniek ??function pageScroll() {
window.scrollBy(0,50); // horizontal and vertical scroll increments
scrolldelay = setTimeout('pageScroll()',100); // scrolls every 100 milliseconds
}
To being scrolling automatically when the page loads, add the following code to the body tag:
<body onLoad="pageScroll()">
To begin scrolling when prompted by the user, call the function from a link or button:
Text Link
<a href="javascriptageScroll()">Scroll Page</a>
Scroll Page (Note: If you click this link, you'll need to click the link at the bottom of the page to cancel the scrolling)
Button
<input type="button" onClick="pageScroll()" value="Scroll Page">
Alvast bedankt voor de antwoorden !!:thumb: