Change DIV contents using jQuery when link clicked

后端 未结 6 1557
梦毁少年i
梦毁少年i 2021-01-26 02:15

Thank you, in advance, for those who answer =)
I\'m trying to switch between divs when i click the links with the respective class (as follow on the code bellow). It works f

6条回答
  •  臣服心动
    2021-01-26 02:54

    This is working fine for u:

      $(document).ready(function () { 
                $(".content").hide();
            });
    
    
    function test(Idpassing) {
                var clsname = Idpassing[0].id;
    
    
                if (clsname == "cont") { $("#info").slideToggle(500); }
                if (clsname == "gal") { $("#gallery").slideToggle(500); }
                if (clsname =="projectos") { $("#projectos").slideToggle(500); }
                if (clsname == "conta") { $("#Contacts").slideToggle(500); }
            }
    
            
              

    Info

    Info content ...

    Contacts

    Contactscontent ...

    Send the data using id

提交回复
热议问题