마우스 오버시 레이어 보이게 하는 팁입니다.
버튼 하나에 레이어 하나 이렇게만 만들다가
지금 작업중인 사이트는 버튼이랑 설명레이어가 여러개가 되길래 만들어봤습니다.
<style type="text/css">
.help_btn{cursor:pointer;}
#help_div_0{display:none; position:absolute; left:0px; top:-210px;}
#help_div_1{display:none; position:absolute; left:80px; top:-210px;}
#help_div_2{display:none; position:absolute; left:185px; top:-210px;}
</style>
<div style="position:relative">
<input type="radio">라디오1 <img src="img/icon_help.gif" class="help_btn">
<input type="radio">라디오2 <img src="img/icon_help.gif" class="help_btn">
<input type="radio">라디오3 <img src="img/icon_help.gif" class="help_btn">
<div id="help_div_0">설명 1</div>
<div id="help_div_1">설명 2</div>
<div id="help_div_2">설명 3</div>
</div>
<script>
$(".help_btn").each(function(index) {
$(this).mouseover(function() {
$("#help_div_" + index).css("display", "block");
});
$(this).mouseout(function() {
$("#help_div_" + index).css("display", "none");
});
});
</script>
더 응용하면 레이어 위치까지도 제어할 수 있을 듯 하네요~
파이어폭스, ie8 만 테스트해봤습니다.
버튼 하나에 레이어 하나 이렇게만 만들다가
지금 작업중인 사이트는 버튼이랑 설명레이어가 여러개가 되길래 만들어봤습니다.
<style type="text/css">
.help_btn{cursor:pointer;}
#help_div_0{display:none; position:absolute; left:0px; top:-210px;}
#help_div_1{display:none; position:absolute; left:80px; top:-210px;}
#help_div_2{display:none; position:absolute; left:185px; top:-210px;}
</style>
<div style="position:relative">
<input type="radio">라디오1 <img src="img/icon_help.gif" class="help_btn">
<input type="radio">라디오2 <img src="img/icon_help.gif" class="help_btn">
<input type="radio">라디오3 <img src="img/icon_help.gif" class="help_btn">
<div id="help_div_0">설명 1</div>
<div id="help_div_1">설명 2</div>
<div id="help_div_2">설명 3</div>
</div>
<script>
$(".help_btn").each(function(index) {
$(this).mouseover(function() {
$("#help_div_" + index).css("display", "block");
});
$(this).mouseout(function() {
$("#help_div_" + index).css("display", "none");
});
});
</script>
더 응용하면 레이어 위치까지도 제어할 수 있을 듯 하네요~
파이어폭스, ie8 만 테스트해봤습니다.
댓글 2개
12년 전
감사합니다~~
takumi22
12년 전
감사합니다.
게시판 목록
팁게시판
디자인과 관련된 유용한 정보를 공유하세요.
질문은 상단의 QA에서 해주시기 바랍니다.
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5202 | 12년 전 | 1587 | ||
| 5201 | 12년 전 | 2721 | ||
| 5200 | 12년 전 | 2095 | ||
| 5199 | 12년 전 | 2078 | ||
| 5198 | 12년 전 | 3724 | ||
| 5197 | 12년 전 | 3046 | ||
| 5196 | 12년 전 | 1550 | ||
| 5195 | 12년 전 | 7624 | ||
| 5194 | 12년 전 | 2527 | ||
| 5193 | 12년 전 | 2808 | ||
| 5192 | 12년 전 | 1871 | ||
| 5191 | 12년 전 | 3525 | ||
| 5190 | 12년 전 | 1456 | ||
| 5189 | 12년 전 | 1424 | ||
| 5188 |
프로프리랜서
|
12년 전 | 2068 | |
| 5187 |
프로프리랜서
|
12년 전 | 1379 | |
| 5186 |
프로프리랜서
|
12년 전 | 1822 | |
| 5185 |
프로프리랜서
|
12년 전 | 1873 | |
| 5184 |
프로프리랜서
|
12년 전 | 1326 | |
| 5183 |
프로프리랜서
|
12년 전 | 1553 | |
| 5182 | 12년 전 | 5231 | ||
| 5181 |
프로프리랜서
|
12년 전 | 1640 | |
| 5180 |
프로프리랜서
|
12년 전 | 958 | |
| 5179 |
프로프리랜서
|
12년 전 | 1333 | |
| 5178 |
프로프리랜서
|
12년 전 | 2434 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기