0

How do I make a automatic scroll when people go on a page?

Here's my current code.

function jumpScroll() {
    window.scroll(0,150); // horizontal and vertical scroll targets
}
Zach Saucier
  • 24,871
  • 12
  • 85
  • 147
Luiz
  • 311
  • 1
  • 3
  • 13

2 Answers2

2

Change scroll to scrollBy

Make sure and add

onLoad="jumpScroll()"

to your body tags.

adanot
  • 318
  • 2
  • 21
0

Hi Please Try the Below Code:

function jumpScroll() {
    window.scrollBy(0,150); // horizontal and vertical scroll increments
    scrolldelay = setTimeout('jumpScroll()',100); // scrolls every 100 milliseconds
}

To being scrolling automatically when the page loads, add the following code to the body tag:

<body onLoad="jumpScroll()">

To begin scrolling when prompted by the user, call the function from a link or button:

<a href="javascript:jumpScroll()">Scroll Page</a>

Button:

<input type="button" onClick="jumpScroll()" value="Scroll Page">

Comple Source: Automatic Scroll

Hope this helps.

Jatin
  • 3,065
  • 6
  • 28
  • 42
  • Looks like this now and see how it works... http://onlythebestoftheweb.x10.mx/navigation/quick.html – Luiz Feb 08 '14 at 03:15