I'm trying to put a method in my website where if a user uses the scroll on their mouse, instead of it scrolling up and down it changes the input to scrolling left and right. I've added something called mousewheel.js to my project and I reference jquery in the header, and I'm running some code that I found on a thread on this site, but I can't get it to work, could anyone please point out what's wrong with my code.
HTML:
<head>
<title> Calendar </title>
<link href="css/style.css" rel="stylesheet" type="text/css" media="screen">
<link rel="stylesheet" href="css/colorbox.css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.colorbox-min.js"></script>
<script type="text/javascript" src="js/jquery.mousewheel.js"></script>
</head>
<body>
<script>$(document).bind('mousewheel', function(event, delta) {
if($(this).scrollLeft()>=0 && $(this).scrollLeft()<=$('body').width())
var k = $(this).scrollLeft()-delta*50;
$(this).scrollLeft(k)
});</script>
Thanks for all help and advise.