Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Horizontal Scroll when scrolling vertical? [closed]

So I have been trying for hours. Any tips or ideas on how to make a webpage scroll horizontal instead of scrolling down?

Edit: When someone scrolls vertically, instead of scrolling vertically you scroll Horizontally.

like image 241
Nolan James Sarlo Avatar asked Oct 28 '25 02:10

Nolan James Sarlo


1 Answers

Here is what you need:

Example: http://css-tricks.com/examples/HorzScrolling/

Code: http://css-tricks.com/snippets/jquery/horz-scroll-with-mouse-wheel/

$(function() {
  $("body").mousewheel(function(event, delta) {
  this.scrollLeft -= (delta * 30);
  event.preventDefault();
  });
})

<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js?ver=1.3.2'></script>
<script type='text/javascript' src='/js/jquery.mousewheel.min.js'></script>

One More Example: http://jsfiddle.net/ye259/4/

like image 194
Jatin Avatar answered Oct 29 '25 18:10

Jatin