Reputation: 161
I have visited the site. There you can see horizontal scrolling and in level 4, you can see the Inverse vertical scrolling. How can I achieve this. Just by using css3
or using some other resources like JS
.
Thanks in advance.
Upvotes: 0
Views: 1905
Reputation: 22643
Using Jquery you could do something like:
$(function() {
$("body").mousewheel(function(event, delta) {
this.scrollLeft -= (delta * 30);
event.preventDefault();
});
});
or
window.onscroll=function() {
var scroll = window.scrollY;
$('article').css('left', '-' + scroll + 'px');
}
make sure that the css fits
section {
overflow:hidden;
height:1024px;
}
article {
width:1024px;/*same as section's height*/
position:fixed; /*you need this to fixe the V-scroll*/
}
article p {
float:left;
}
Html
<section>
<article>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting </p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting </p>
</article>
</section>
Upvotes: 1