• 회원가입
  • 로그인
  • 구글아이디로 로그인

[JS-서기] JQ 4강 - 허버메뉴

1,171  

예제

 

<style>

#hz ul {margin:0; padding:0}

#hz li {float:left; list-style:none; width:20%; border:1px solid red; margin-right:-1px; box-sizing:border-box;}

#hz li a.off {display:block; padding:20px; text-align:center; text-decoration:none;}

#hz li a.on {background:red; color:white;}

</style>


<script src="http://code.jquery.com/jquery-latest.js"></script>


<script>

$(document).ready(function(){

     $('.off').mouseover( function() {

         $(this).addClass('on');

     });

     $('.off').mouseleave( function() {

         $(this).removeClass('on');

     });

});

</script>


<div id='hz' class=''>

<ul id='' class=''>

<li class=''>

<a href='' target='' title='' class='off'>홈짱닷컴</a>

</li>

<li class=''>

<a href='' target='' title='' class='off'>HTML</a>

</li>

<li class=''>

<a href='' target='' title='' class='off'>CSS</a>

</li>

<li class=''>

<a href='' target='' title='' class='off'>JS</a>

</li>

<li class=''>

<a href='' target='' title='' class='off'>JQUERY</a>

</li>

</ul>

</div>

 

 

결과 보기 



분류 제목
JS-생코 JS 86강 - 상속 (2/3) : 상속의 사용방법
JS-생코 JS 85강 - 상속 (1/3) : 상속이란?
JS-생코 JS 84강 - this (5/5) : apply와 this
JS-생코 JS 83강 - this (4/5) : 객체로서 함수
JS-생코 JS 82강 - this (3/4) : 생성자와 this
JS-생코 JS 81강 - this (2/5) : 메소드와 this
JS-생코 JS 80강 - this (1/5) : 함수와 this
JS-생코 JS 79강 - 전역객체
JS-생코 JS 78강 - 생성자와 new (3/3) : 생성자와 new
JS-생코 JS 77강 - 생성자와 new (2/3) : 객체생성
JS-생코 JS 76강 - 생성자와 new (1/3) : 소개
JS-생코 JS 75강 - 객체지향프로그래밍 (3/3) : 부품화
JS-생코 JS 74강 - 객체지향프로그래밍 (2/3) : 추상화
JS-생코 JS 73강 - 객체지향프로그래밍 (1/3) : 오리엔테이션
JS-생코 JS 72강 - 함수의 호출 (2/2) : apply의 사용
JS-생코 JS 71강 - 함수의 호출 (1/2) : apply 소개
JS-생코 JS 70강 - arguments (2/2) : function length
JS-생코 JS 69강 - arguments (1/2) : arguments란?
JS-생코 JS 68강 - 클로저 (closure) 4/4 : 클로저의 응용
JS-생코 JS 67강 - 클로저 (closure) 3/4 : private variable
23/35
목록
찾아주셔서 감사합니다. Since 2012