There is the code $("#d3").click(function(){ $(this).toggleClass('my3d'); $("a").removeAttr("class"); $(".main-cube").css("top", "10%"); $(".cube").css({width: "95vw", height: "45vh"}); $(".side").css({position: "static", transform: "none", width: "95vw", height: "90vh"}); });
In it, I specifically need to remove the class attribute from the links so that it does not activate the rotation of the shape. That is, when you click on the link, nothing happens. But for some reason attribute removal does not work. When you click for example on aa with the class link2, the rotation of the shape starts (in another jQuery code), in spite of any of my witchcraft. How is that???
Here is the HTML code to which I want to apply the removal:
<ul class="main-menu loft-mnu"> <li><a class="link1" href="#side1">Главная</a></li> <li><a class="link2" href="#side2">О компании</a></li> <li><a class="link3" href="#side3">Услуги</a></li> <li><a class="link4" href="#side4">Заказать сайт</a></li> <li><a class="link5" href="#side5">Цены</a></li> <li><a class="link6" href="#side6">Контакты</a></li> </ul> "Other Code"
$(".link2").on("click", function() { $('.side') .animate({ width: "600px" }, 1000 ) .animate({ height: "600px" }, 1000 ); $(".cube").css({width: "600px", height: "600px", left: "0"}); setTimeout (function () { $('.cube').css("transform", "rotate3d(0,1,0,270deg)"); }, 2500 ); setTimeout (function () { $(".cube").css({width: "95vw", height: "45vh"}); $('.main-cube').css({top: "10%", perspective: "2000px"}); $('.side2') .animate({ width: "95vw" }, 1000 ) .animate({ height: "90vh" }, 1000 ); }, 5000 ); });