1/* 2 æ¬å¤æç±é»¯é²ï¼AnYunï¼æ°å¯«ï¼æ¡è¿ä¿®æ¹ï¼ 3 使¯è¨å¾å°æç¶²èªå享修æ¹çµæåï¼ 4 5 æå¸ç¶²åï¼http://coding.anyun.idv.tw/2012/03/03/jquery-tab/ 6 7 çæ¬ï¼1.0.0 8*/ 9(function ($) { 10 11 $.fn.tab = function (options) { 12 13 var settings = $.extend({ 14 'tabbtn': '.TabBtn li a', // Tab æé 15 'tabcontent': '.TabText>div', // å §æåå¡ 16 'activecss': 'active', // é»é¸ä¸çæ¨£å¼ 17 'event': 'click' // äºä»¶ãå¯ä»¥æ¹æ mouseenter ï¼å°±æ¯æ»é¼ ç§»éå»çäºä»¶ 18 }, options); 19 20 return this.each(function () { 21 $this = $(this); 22 $tabbtn = $this.find(settings.tabbtn); 23 $tabcontent = $this.find(settings.tabcontent); 24 $activecss = settings.activecss; 25 $event = settings.event; 26 27 $tabcontent.hide().eq(0).show(); // 顯示第ä¸åå §æ 28 $tabbtn.eq(0).parent().attr('class', $activecss); // è¨å®ç¬¬ä¸å Tab æéæ¨£å¼ 29 30 // è¨å® Tab æéäºä»¶ 31 $tabbtn.bind($event, function (i) { 32 var i = $tabbtn.index(this); 33 $tabcontent.hide().eq(i).show(); // 顯示é»é¸çå §å®¹ 34 $tabbtn.parent().removeClass().eq(i).attr('class', $activecss); // è¨å®é»é¸çé ç±¤å §å®¹ 35 }); 36 37 }); 38 }; 39})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.