jeudi 16 avril 2015

slowing down javascript autoscroll function

humble newbie here. i found this javascript autoscroll function and got it to work by pasting it in the header file of a wordpress site. however, i'd like to slow down the scroll so that it does not immediately snap to the bottom of the page. i am brand new to javascript and could not get any other autoscroll functions to work on my site so am hoping i can just adjust this function by adding a speed variable. many thanks!



<script type="text/javascript"><!--

function AutoScrollOnload() {


var InFromLeft = 172;
var DownFromTop = 964;


window.scrollTo(InFromLeft,DownFromTop);
}
function AddOnloadEvent(f) {
if(typeof window.onload != 'function') { window.onload = f; }
else {
var cache = window.onload;
window.onload = function() {
if(cache) { cache(); }
f();
};
}
}
AddOnloadEvent(AutoScrollOnload);
//--></script>

Aucun commentaire:

Enregistrer un commentaire