0

http://rockforddriveline.com/newrdl/index.html

That is the test website. Its a WIP, don't discuss the design. Just the functionality.

So, I've edited my post, and I've changed my code to the bare minimum to the point to where it works. My issue is that during the transition between the .tile and main, it hides both of them which then displays nothing. I want to be able to make sure that doesn't happen. I have two methods I think that'll solve it. Either by stopping input of the mouse during the animation or use a listener to see when both .m1/2/3/4 and .t1/2/3/4 are :hidden. I don't know how to do either of those.

.stop() did not solve my problem.

var varMainHide = '.m1, .m2, .m3, .m4',
    varTileHide = '.t1, .t2, .t3, .t4',
    varAllHide = varMainHide + ', ' + varMainHide;

function funcSimpleTransition(fMain, button){

    $(button).click(function() {
            $(varMainHide).hide();
            $('.tile').hide(500);
            $(fMain).show(300);         
    });
    $('.overide').click(function() {
        $(varMainHide).hide(200);
        $('.tile').show();
    });
};

function funcMasterScript(){
    $(varMainHide).hide();
    funcSimpleTransition('.m1', '.t1');
    funcSimpleTransition('.m2', '.t2');
    funcSimpleTransition('.m3', '.t3');
    funcSimpleTransition('.m4', '.t4');
};

0 Answers0