테스트 사이트 - 개발 중인 베타 버전입니다

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

· 12년 전 · 7598 · 2
마우스 오버시 레이어 보이게 하는 팁입니다.

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

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

감사합니다~~
감사합니다.

게시글 목록

번호 제목
28080
7612
7598
7595
19842
28079
19840
7593
28076
7590
28072
28065
19836
7586
28058
7573
31754
7552
28057
30993
28052
7546
7544
7538
7519
30992
19834
7517
7512
7511
19832
19820
7509
24658
7508
7507
19818
30990
7506
7505
7498
7492
28051
7481
30988
19813
19812
7477
7476
7471
7467
19810
7464
19809
7463
7457
30980
7450
28043
7447
7440
28040
7438
7430
7427
7423
7414
7408
7405
7401
7400
19808
7398
7393
7389
19805
7382
7379
7378
7363
7361
7356
19804
7355
7352
19786
7342
7336
7332
19783
7328
7325
7324
28036
19782
7321
26574
7314
7312
19781