책에 나온거 응용해 보았습니다.
<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에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5627 |
멋진남자임
|
10년 전 | 1451 | |
| 5626 | 10년 전 | 3862 | ||
| 5625 |
멋진남자임
|
10년 전 | 1521 | |
| 5624 | 10년 전 | 2089 | ||
| 5623 | 10년 전 | 1553 | ||
| 5622 |
네이비칼라
|
10년 전 | 1603 | |
| 5621 |
멋진남자임
|
10년 전 | 1399 | |
| 5620 |
잘살아보자
|
10년 전 | 1086 | |
| 5619 | 10년 전 | 3401 | ||
| 5618 |
이웃집초보
|
11년 전 | 1273 | |
| 5617 |
|
11년 전 | 4610 | |
| 5616 |
멋진남자임
|
11년 전 | 1094 | |
| 5615 |
멋진남자임
|
11년 전 | 1362 | |
| 5614 | 11년 전 | 4481 | ||
| 5613 |
파랑새1597
|
11년 전 | 2596 | |
| 5612 | 11년 전 | 1995 | ||
| 5611 |
잘살아보자
|
11년 전 | 5237 | |
| 5610 |
잘살아보자
|
11년 전 | 2137 | |
| 5609 |
잘살아보자
|
11년 전 | 3206 | |
| 5608 |
잘살아보자
|
11년 전 | 4123 | |
| 5607 |
잘살아보자
|
11년 전 | 1935 | |
| 5606 |
잘살아보자
|
11년 전 | 1897 | |
| 5605 |
잘살아보자
|
11년 전 | 5711 | |
| 5604 |
잘살아보자
|
11년 전 | 2676 | |
| 5603 |
잘살아보자
|
11년 전 | 994 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기