책에 나온거 응용해 보았습니다.
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script src="scripts/jquery.js"></script>
<style>
.tooltip {
position: absolute;
z-index: 2;
background: #efd;
border: 1px solid #ccc;
padding: 3px;
}
</style>
</HEAD>
<BODY>
<span id='mover' tip='툴팁입니다.'>마우스오버</span>
<script>
$(document).ready(function() {
var highlighted = "";
var column = 3;
var positionTooltip = function(event) {
var tPosX = event.pageX;
var tPosY = event.pageY+20;
$('div.tooltip').css({top: tPosY, left: tPosX});
};
var showTooltip = function(event) {
$('div.tooltip').remove();
$('<div class="tooltip">' + $(this).attr('tip') + '</div>').appendTo('body');
positionTooltip(event);
};
var hideTooltip = function() {
$('div.tooltip').remove();
};
$('#mover')
.hover(showTooltip, hideTooltip)
.mousemove(positionTooltip);
});
</script>
</BODY>
</HTML>
댓글 3개
<?=help("목록 한페이지당 라인수")?>
/adm/admin.lib.php에서...
function help($help="", $left=0, $top=0)
{
global $g4;
static $idx = 0;
$idx++;
$help = preg_replace("/\n/", "<br>", $help);
$str = "<img src='$g4[admin_path]/img/icon_help.gif' border=0 width=15 height=15 align=absmiddle onclick=\"help('help$idx', $left, $top);\" style='cursor:hand;'>";
//$str .= "<div id='help$idx' style='position:absolute; top:0px; left:0px; display:none;'>";
$str .= "<div id='help$idx' style='position:absolute; display:none;'>";
$str .= "<div id='csshelp1'><div id='csshelp2'><div id='csshelp3'>$help</div></div></div>";
$str .= "</div>";
return $str;
}
style 부분은 style.css에 넣겠지만,
$('#mover') 같은 부분을 범용화 하는거는 간단하지만 꽤 어렵네요. ㅠ..ㅠ...
시간될 때 플러그인을 한번 봐야겠어요. 코딩 스탈이 어떻게 된 것인지
게시판 목록
팁게시판
질문은 상단의 QA에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5502 | 11년 전 | 3841 | ||
| 5501 | 11년 전 | 1132 | ||
| 5500 |
잘살아보자
|
11년 전 | 897 | |
| 5499 |
kiplayer
|
11년 전 | 7431 | |
| 5498 |
잘살아보자
|
11년 전 | 2308 | |
| 5497 |
잘살아보자
|
11년 전 | 1125 | |
| 5496 |
잘살아보자
|
11년 전 | 1163 | |
| 5495 |
잘살아보자
|
11년 전 | 958 | |
| 5494 |
잘살아보자
|
11년 전 | 4549 | |
| 5493 |
잘살아보자
|
11년 전 | 672 | |
| 5492 |
잘살아보자
|
11년 전 | 5223 | |
| 5491 |
잘살아보자
|
11년 전 | 3372 | |
| 5490 | 11년 전 | 1184 | ||
| 5489 |
|
11년 전 | 3273 | |
| 5488 |
잘살아보자
|
11년 전 | 2821 | |
| 5487 |
잘살아보자
|
11년 전 | 2197 | |
| 5486 |
잘살아보자
|
11년 전 | 1434 | |
| 5485 |
잘살아보자
|
11년 전 | 1448 | |
| 5484 |
잘살아보자
|
11년 전 | 2332 | |
| 5483 |
잘살아보자
|
11년 전 | 3236 | |
| 5482 |
잘살아보자
|
11년 전 | 1120 | |
| 5481 |
잘살아보자
|
11년 전 | 728 | |
| 5480 |
잘살아보자
|
11년 전 | 1361 | |
| 5479 |
잘살아보자
|
11년 전 | 669 | |
| 5478 |
잘살아보자
|
11년 전 | 1246 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기