jQuery can't get if statement to work

Posted by jstacks on Stack Overflow See other posts from Stack Overflow or by jstacks
Published on 2012-11-19T01:09:41Z Indexed on 2012/11/19 5:00 UTC
Read the original article Hit count: 129

Filed under:
|

I'm looking help with an If Statement. I'm trying to finalize this horizontal scrolling I have and the last bit is to not just disable scrolling when the end is reached, but to also disable (well, change color) the scroll buttons at that point as well. And change back when they are scrollable again.

http://jsfiddle.net/stfzy/83/

EDIT* I've updated the JQuery and have everything working except just one if statement:

$('div#arrowL').click(function(){
    if(index < 0 ){ //can't scroll
        $('div#arrowL').addClass('active');
    }
});        

I need to add this class back when you can't scroll left anymore. And I think the issue is with the "index < 0" portion but I don't see what I need to change it to to get it to work.

Any help is appreciated.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about if-statement