리자

간단한 풍선도움말

책에 나온거 응용해 보았습니다.


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

[이 게시물은 관리자님에 의해 2011-10-31 16:55:28 jQuery에서 이동 됨]
|

댓글 3개

현재 /adm/에서 사용하는 help

<?=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') 같은 부분을 범용화 하는거는 간단하지만 꽤 어렵네요. ㅠ..ㅠ...

시간될 때 플러그인을 한번 봐야겠어요. 코딩 스탈이 어떻게 된 것인지
좋은소스 감사드립니다.^^
댓글을 작성하시려면 로그인이 필요합니다.

프로그램

+
제목 글쓴이 날짜 조회
16년 전 조회 2,168
16년 전 조회 1,747
16년 전 조회 1,516
16년 전 조회 2,050
16년 전 조회 4,734
17년 전 조회 1,420
17년 전 조회 2,158
17년 전 조회 2,138
17년 전 조회 2,411
17년 전 조회 2,157
17년 전 조회 4,442
17년 전 조회 2,940
17년 전 조회 2,875
17년 전 조회 1,607
17년 전 조회 1,245
17년 전 조회 3,954
17년 전 조회 1,626
17년 전 조회 1,619
17년 전 조회 2,121
17년 전 조회 1,889
17년 전 조회 1,504
17년 전 조회 3,924
17년 전 조회 1,763
17년 전 조회 3,136
17년 전 조회 3,014
17년 전 조회 1,047
17년 전 조회 1,856
17년 전 조회 1,600
17년 전 조회 1,859
17년 전 조회 2,649
17년 전 조회 3,031
17년 전 조회 3,227
17년 전 조회 3,333
17년 전 조회 1,467
17년 전 조회 1,427
17년 전 조회 2,262
17년 전 조회 1,985
17년 전 조회 2,297
17년 전 조회 2,822
17년 전 조회 3,270
17년 전 조회 2,371
17년 전 조회 1,639
17년 전 조회 3,213
17년 전 조회 3,078
17년 전 조회 3,052
17년 전 조회 3,920
17년 전 조회 2,594
17년 전 조회 2,415
17년 전 조회 2,665
17년 전 조회 2,902
17년 전 조회 2,618
17년 전 조회 1,461
17년 전 조회 1,907
17년 전 조회 1,497
17년 전 조회 1,922
17년 전 조회 2,520
17년 전 조회 8,702
17년 전 조회 3,162
17년 전 조회 4,250
17년 전 조회 1,989
17년 전 조회 3,667
17년 전 조회 1,561
17년 전 조회 1,393
17년 전 조회 2,331
17년 전 조회 1,323
17년 전 조회 1,639
17년 전 조회 1,474
17년 전 조회 2,540
17년 전 조회 1,507
17년 전 조회 1,098
17년 전 조회 1,232
17년 전 조회 3,108
17년 전 조회 2,173
17년 전 조회 1,979
17년 전 조회 1,223
17년 전 조회 2,455
17년 전 조회 1,175
17년 전 조회 1,138
17년 전 조회 1,384
17년 전 조회 2,747
17년 전 조회 2,401
17년 전 조회 2,489
17년 전 조회 1,189
17년 전 조회 1,306
17년 전 조회 3,251
17년 전 조회 2,835
17년 전 조회 4,107
17년 전 조회 2,268
17년 전 조회 2,362
17년 전 조회 1,414
17년 전 조회 2,533
17년 전 조회 2,220
17년 전 조회 2,975
17년 전 조회 2,487
17년 전 조회 1,647
17년 전 조회 2,439
17년 전 조회 1,596
17년 전 조회 1,184
17년 전 조회 2,244
17년 전 조회 2,890
🐛 버그신고