If you placed your code exactly as it is, there are many syntax errors. Fixed version below:
$('.next').click(function (event) { // missing $/jQuery window.location = $('li').next(); }); // missing the close parentheses
Also, since you are doing things with jQuery, you may need to use something like:
EDIT
If it is horizontal, you only need to adjust the scroll code. eg:.
$(window).scrollLeft(selector.position().left);
EDIT No. 2
Here is a very simple example of what I think you are trying to achieve:
http://jsfiddle.net/FsjkM/
Click on the HTML part and it will move to the next element of the list (note the change in number).
In your real application, you will need to track or calculate the βcurrentβ element in order to use the previous / next functionality.
Ultimate EDIT
http://jsfiddle.net/FsjkM/1/
I modified this a bit to give you an idea of ββwhat a more complete structure would look like. Note that border checking does not exist - if you press prev at the beginning or at the end, it will break.
user1122345 Jul 29 '11 at 2:29 2011-07-29 02:29
source share