I am trying to write a button with scrollTo(); but it doesn't seem to be working. Also, is there any way to get this function to work so it scrolls to an element (in my case a nav bar...) rather than pixel coordinates?
Here is my code:
<figure id="LoadVideo">
<button type="button" onclick="ScrollDown()"> Scroll Down</button>
<script>
function scrollDown(){
window.scrollTo(0,500);
}
</script>
<video id="LoadVid" autoplay src="images/LoadVid.mov" type="video/mov">
</video>
</figure>
Also if there could be any way to get animation on the button (like to come in after 7 seconds) that anybody can help with that would be awesome!
Thanks so much!
M.C.
onlick...which is not an event that a computer can capture. You probably meantonclick. Also, since JavaScript is case-sensitive, make sure you callscrollDown()and notScrollDown().