책에 나온거 응용해 보았습니다.
<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에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 6077 | 9년 전 | 194 | ||
| 6076 |
PlayPixel
|
9년 전 | 213 | |
| 6075 | 9년 전 | 207 | ||
| 6074 | 9년 전 | 263 | ||
| 6073 |
|
9년 전 | 228 | |
| 6072 |
|
9년 전 | 385 | |
| 6071 | 9년 전 | 306 | ||
| 6070 |
|
9년 전 | 343 | |
| 6069 | 9년 전 | 314 | ||
| 6068 |
|
9년 전 | 259 | |
| 6067 | 9년 전 | 268 | ||
| 6066 |
|
9년 전 | 394 | |
| 6065 |
PASKRAN
|
9년 전 | 278 | |
| 6064 | 9년 전 | 304 | ||
| 6063 |
kiplayer
|
9년 전 | 380 | |
| 6062 |
|
9년 전 | 342 | |
| 6061 | 9년 전 | 279 | ||
| 6060 |
|
9년 전 | 340 | |
| 6059 |
|
9년 전 | 294 | |
| 6058 |
|
9년 전 | 284 | |
| 6057 | 9년 전 | 329 | ||
| 6056 |
|
9년 전 | 260 | |
| 6055 |
|
9년 전 | 321 | |
| 6054 |
|
9년 전 | 298 | |
| 6053 |
snshero
|
9년 전 | 662 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기