mardi 8 septembre 2015

if, else if, else instructions

I have an error in my javascript and I don't know how to solve this: I got a "Uncaught SyntaxError: Unexpected token {" at the line with the else if.

$(SECTION_SEL).on('click touchstart', SLIDES_ARROW_SEL, function() {
        if ($(this).hasClass(SLIDES_PREV)) {
            if(isScrollAllowed.m.left){
                FP.moveSlideLeft();
            }
        }else if ($(this).hasClass(SLIDES_NEXT) { 
            if(isScrollAllowed.m.right){
                FP.moveSlideRight();
            }
        }else if ($(this).hasClass(SLIDES_UP) {
            if(isScrollAllowed.m.up){
                FP.moveSlideUp();
            }
        }else ($(this).hasClass(SLIDES_DOWN) {
            if(isScrollAllowed.m.down){
                FP.moveSlideDown();
            }
        }
    });

Aucun commentaire:

Enregistrer un commentaire