I have two divs with:
width:100%; height:100%
therefore my entire document is 200% high; both divs have a link to each other,
now when I click on the link, I want the site to move smoothly to another div,
I know how this will work in jquery, for example with .scrollto, but my client wants to use wihout applications. Only javascricpt and css!
I tried to achieve it using translateY, but it will not work!
Here is sample code:
http://jsfiddle.net/hSU7R/
HTML
<div class="full" id="one">
<span style="width:100%; background-color:blue">
<a href="#two" >Scroll to 2</a>
</span>
</div>
<div class="full" id="two">
<span style="width:100%; background-color:blue">
<a href="#one" >Scroll to 1</a></span>
</div>
CSS
html,body {
width:100%;
height:100%;}
.full {
height:100%;
width:100%;}
#one {background-color:green}
#two {background-color:red}
source
share