뽁

마우스 오버시 레이어 출력~

마우스 오버시 레이어 보이게 하는 팁입니다.

버튼 하나에 레이어 하나 이렇게만 만들다가
지금 작업중인 사이트는 버튼이랑 설명레이어가 여러개가 되길래 만들어봤습니다.

<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개

댓글을 작성하시려면 로그인이 필요합니다.

프로그램

8,188건
+
제목 글쓴이 날짜 조회
16-07-13 조회 2,148
16-07-12 조회 2,314
16-07-12 조회 2,339
16-07-11 조회 2,175
16-06-05 조회 2,866
16-06-03 조회 2,974
16-05-26 조회 2,894
15-09-22 조회 4,946
15-06-10 조회 4,794
14-10-25 조회 6,325
14-10-22 조회 8,945
14-09-21 조회 5,748
14-09-16 조회 5,033
14-08-22 조회 1만
14-08-13 조회 5,868
14-08-12 조회 5,408
14-08-12 조회 6,260
14-08-11 조회 6,882
14-06-12 조회 6,171
14-06-11 조회 5,081
14-05-09 조회 5,387
14-05-09 조회 6,347
14-05-09 조회 6,380
14-05-08 조회 5,706
14-04-17 조회 4,711
14-04-16 조회 4,543
14-04-15 조회 4,550
14-04-15 조회 4,500
14-04-15 조회 4,269
14-04-14 조회 4,250
14-04-14 조회 4,207
14-04-14 조회 4,600
14-04-14 조회 4,744
14-04-14 조회 4,730
14-04-13 조회 4,620
14-04-12 조회 4,190
14-04-12 조회 4,344
14-04-12 조회 4,445
14-04-11 조회 4,976
14-04-10 조회 4,709
14-04-10 조회 4,748
14-04-09 조회 4,893
14-04-09 조회 5,262
14-04-08 조회 6,927
13-10-30 조회 7,636
13-07-11 조회 5,094
13-03-28 조회 1.1만
13-02-27 조회 6,742
13-02-14 조회 5,563
13-01-10 조회 4,489
12-12-31 조회 5,056
12-12-20 조회 6,086
12-12-12 조회 5,245
12-12-07 조회 4,460
12-11-28 조회 4,812
12-11-22 조회 5,246
12-11-12 조회 5,610
12-09-22 조회 4,485
12-09-18 조회 4,675