dansui
dansui

Reputation: 45

jQuery animation() not working

Sorry but I just can't for the world understand why it isn't working. Been testing different things the whole day. I suspected my different jQuery sources but testing in jSFiddle gives me the same result. This should be an easy fix. I just want an animation when clicking on one of the circles to bring up a submenu from the right side of the screen.

The Fiddle http://jsfiddle.net/YWTt2/14/

The html part is mainly SVG stuff so there's noting to see, below is the JavaScript part and it's all in the jsfiddle.

//Function for opening submenus and animation
    $(document).on("click", "a[name='menu1']", function (e) {
    e.preventDefault();
    $("#menu1").css({visibility:"visible"});
        $("#menu1").animate({left:'550px'});
    //$("#menu1").slideDown(5110);
    });

      $(document).on("click", "a[name='menu2']", function (e) {
    e.preventDefault();
    $("#menu2").css({visibility:"visible"});
    });

    $(document).on("click", "a[name='menu3']", function (e) {
    e.preventDefault();
    $("#menu3").css({visibility:"visible"});
    });
    $(document).on("click", "a[name='menu4']", function (e) {
    e.preventDefault();
    $("#menu4").css({visibility:"visible"});
    });
     $(document).on("click", "a[name='menu5']", function (e) {
    e.preventDefault();
    $("#menu5").css({visibility:"visible"});
    });


     //Closes the open submenus
     $("#controlnav").on("click", function (e) {
    $("#menu1,#menu2,#menu3,#menu4,#menu5").css({visibility:"hidden"});
    });

Upvotes: 1

Views: 111

Answers (2)

Pragnesh Rupapara
Pragnesh Rupapara

Reputation: 802

Your code is fine, You just need to update the jQuery file to the latest one (jQuery 2.x).

check this fiddle : http://jsfiddle.net/pragneshok/YWTt2/15/

Upvotes: 2

Calin Sargan
Calin Sargan

Reputation: 61

The problem is the tag. Is not supported.

Check out this answer: jQuery animate <object> tag

Upvotes: 1

Related Questions