---
description: 흔희쓰는 탭
---

# TAB

```
<script>
	$(function(){
		var tab = $('._slide > li') , info = $('.currsec');

		var current = -1;
		tab.click(function(e){
			var t = e.currentTarget;
			var index = tab.index(t);
			if (current === index){
			 	return;
			 }

			current = index;
			tab.removeClass('on');
			$(t).addClass('on');

			info.hide();
			info.eq(current).fadeIn();
		});

		tab.eq(0).trigger('click'); //tab0번쩨에 click를 넣어
	});
</script>
```

```
		
				<ul class="_slide">
					<li><a href="#">TAB1</a><span class="line"></span></li>
					<li><a href="#">TAB2</a><span class="line"></span></li>
				</ul>						
				<div class="currsec"></div>
```
