책에 나온거 응용해 보았습니다.
<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에서 해주시기 바랍니다.
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 5852 | 9년 전 | 621 | ||
| 5851 | 9년 전 | 553 | ||
| 5850 | 9년 전 | 402 | ||
| 5849 | 9년 전 | 306 | ||
| 5848 | 9년 전 | 307 | ||
| 5847 | 9년 전 | 300 | ||
| 5846 | 9년 전 | 285 | ||
| 5845 | 9년 전 | 308 | ||
| 5844 | 9년 전 | 330 | ||
| 5843 | 9년 전 | 423 | ||
| 5842 | 9년 전 | 315 | ||
| 5841 | 9년 전 | 1082 | ||
| 5840 |
|
9년 전 | 1209 | |
| 5839 | 9년 전 | 593 | ||
| 5838 | 9년 전 | 322 | ||
| 5837 | 9년 전 | 374 | ||
| 5836 | 9년 전 | 373 | ||
| 5835 | 9년 전 | 497 | ||
| 5834 | 9년 전 | 341 | ||
| 5833 | 9년 전 | 456 | ||
| 5832 | 9년 전 | 288 | ||
| 5831 | 9년 전 | 274 | ||
| 5830 | 9년 전 | 292 | ||
| 5829 | 9년 전 | 341 | ||
| 5828 | 9년 전 | 319 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기