I know this code is super lame but it was working very well ’till now so I kept it.
But now I have too many < li >’s and I can’t add them manually in the js because it’s on wordpress and it depends on the category page so the number of < li >’s changes every time.
My question is; how can I keep that animation and make it work with an undefined number of < li >’s without having to add them manually? And is there a way to stop the scroll bar scrolling-away without using the css overflow-y: hidden ?!
HERE’S THE DEMO:
http://jsfiddle.net/NdRDh/
Thank you very much! Hope you can help me!!
Tom
I’d suggest:
JS Fiddle demo.
Oh, and please note that you’re repeating the same
idfor all of yourlielements: this is invalid HTML, as:(Quoted from: http://www.w3.org/TR/html401/struct/global.html#h-7.5.2)
References:
each().