JS Anchor jumping
by lun471k
HTML
<div id="click" style="width:400px; height:870px;">content that triggers the event</div>
<p id="bottom_anchor">The content I want to read.</p>
CSS
div
{
background-color:#00BFFF;
}
p
{
background-color: #F00;
}
JavaScript
function scrollDown()
{
var url = location.href;
location.href = "#bottom_anchor";
return true;
}
var trigger = document.getElementById("click");
trigger.addEventListener("click",scrollDown,false);