tab kakunou by using eq

(function($){ $(document).ready(function(){ var tablist = $("#tab_head li"); var tabbody = $("#tab_body li"); tablist.click(function(){ var idx = tablist.index($(this)); tablist.removeClass("on").eq(idx).addClass("on"); tabbody.removeClass("on").eq(idx).addClass("on"); }); }); indexとeqの使い方がうまい

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.