마우스 오버시 레이어 보이게 하는 팁입니다.
버튼 하나에 레이어 하나 이렇게만 만들다가
지금 작업중인 사이트는 버튼이랑 설명레이어가 여러개가 되길래 만들어봤습니다.
<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년 전
감사합니다.
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 30 |
아우겐나이스
|
21년 전 | 4093 | |
| 29 |
아우겐나이스
|
21년 전 | 4471 | |
| 28 |
아우겐나이스
|
21년 전 | 3497 | |
| 27 | 21년 전 | 5878 | ||
| 26 | 21년 전 | 3151 | ||
| 25 | 21년 전 | 6128 | ||
| 24 | 18년 전 | 3690 | ||
| 23 | 21년 전 | 3682 | ||
| 22 | 21년 전 | 4276 | ||
| 21 | 21년 전 | 3863 | ||
| 20 | 21년 전 | 4261 | ||
| 19 | 21년 전 | 6719 | ||
| 18 | 21년 전 | 4764 | ||
| 17 | 21년 전 | 7013 | ||
| 16 | 21년 전 | 4200 | ||
| 15 | 21년 전 | 2667 | ||
| 14 | 21년 전 | 5003 | ||
| 13 | 21년 전 | 3424 | ||
| 12 |
Recluse
|
21년 전 | 3906 | |
| 11 |
아우겐나이스
|
21년 전 | 3592 | |
| 10 |
Recluse
|
21년 전 | 3430 | |
| 9 | 21년 전 | 4045 | ||
| 8 | 21년 전 | 5212 | ||
| 7 | 21년 전 | 4791 | ||
| 6 | 21년 전 | 5731 | ||
| 5 | 21년 전 | 4148 | ||
| 4 | 21년 전 | 4885 | ||
| 3 | 21년 전 | 4781 | ||
| 2 | 21년 전 | 3285 | ||
| 1 | 22년 전 | 4370 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기