jQuery fadeIn and fadeOut - swapping divs

后端 未结 6 1130
挽巷
挽巷 2021-01-25 19:33

I\'m new to jQuery and javascript in general but am plugging my way through thanks to sites like these.

I have a page with six hidden divs that are called with correspon

6条回答
  •  北恋
    北恋 (楼主)
    2021-01-25 20:17

    $(document).ready(function(){
    
       $("a[id^='link']").click(function() {
          $("div[id^='panel']").fadeOut("slow");
          $("div#"+this.id.replace('link', 'panel')).fadeIn("slow");
       });
    });
    

提交回复
热议问题