vendredi 28 avril 2017

jQuery in Safari is not working properly

I have the following code to open and close my side nav with a overlay.. it works perfectly on chrome but in safari it just breaks so I am guessing their is some compatibility issue with the version of code.

$(document).ready(function () {
        $(function () {
            $('.sidenav-button').click(function () {
                if ($(this).hasClass('show')) {
                    $(".sidenavbody-overlay").fadeIn(500);
                    $(".sidenav-button, .sidenav-panel").animate({
                        left: "-=25%"
                    }, 700, function () {
                        // Animation complete.
                    });
                    $(this).html('').removeClass('show').addClass('hide');

                }
                else {
                    $(".sidenavbody-overlay").fadeOut(400);
                    $(".sidenav-button, .sidenav-panel").animate({
                        left: "+=25%"
                    }, 700, function () {
                        // Animation complete.
                    });
                    $(this).html('').removeClass('hide').addClass('show');

                }


            });


        });

$('.sidenavbody-overlay').click(function(){    

    $('.sidenav-button').trigger('click');
});

});




Aucun commentaire:

Enregistrer un commentaire