리자

간단한 풍선도움말

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


<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,163
16년 전 조회 1,736
16년 전 조회 1,504
16년 전 조회 2,038
16년 전 조회 4,724
16년 전 조회 1,412
17년 전 조회 2,147
17년 전 조회 2,130
17년 전 조회 2,398
17년 전 조회 2,144
17년 전 조회 4,428
17년 전 조회 2,927
17년 전 조회 2,862
17년 전 조회 1,595
17년 전 조회 1,234
17년 전 조회 3,940
17년 전 조회 1,613
17년 전 조회 1,605
17년 전 조회 2,106
17년 전 조회 1,877
17년 전 조회 1,492
17년 전 조회 3,914
17년 전 조회 1,752
17년 전 조회 3,126
17년 전 조회 3,004
17년 전 조회 1,035
17년 전 조회 1,845
17년 전 조회 1,586
17년 전 조회 1,849
17년 전 조회 2,636
17년 전 조회 3,021
17년 전 조회 3,213
17년 전 조회 3,321
17년 전 조회 1,458
17년 전 조회 1,415
17년 전 조회 2,248
17년 전 조회 1,971
17년 전 조회 2,287
17년 전 조회 2,811
17년 전 조회 3,260
17년 전 조회 2,361
17년 전 조회 1,629
17년 전 조회 3,202
17년 전 조회 3,069
17년 전 조회 3,043
17년 전 조회 3,912
17년 전 조회 2,584
17년 전 조회 2,404
17년 전 조회 2,653
17년 전 조회 2,894
17년 전 조회 2,608
17년 전 조회 1,449
17년 전 조회 1,894
17년 전 조회 1,486
17년 전 조회 1,909
17년 전 조회 2,508
17년 전 조회 8,693
17년 전 조회 3,151
17년 전 조회 4,241
17년 전 조회 1,981
17년 전 조회 3,656
17년 전 조회 1,551
17년 전 조회 1,384
17년 전 조회 2,320
17년 전 조회 1,313
17년 전 조회 1,627
17년 전 조회 1,460
17년 전 조회 2,529
17년 전 조회 1,495
17년 전 조회 1,088
17년 전 조회 1,221
17년 전 조회 3,098
17년 전 조회 2,162
17년 전 조회 1,967
17년 전 조회 1,212
17년 전 조회 2,447
17년 전 조회 1,167
17년 전 조회 1,127
17년 전 조회 1,373
17년 전 조회 2,737
17년 전 조회 2,392
17년 전 조회 2,476
17년 전 조회 1,177
17년 전 조회 1,294
17년 전 조회 3,243
17년 전 조회 2,828
17년 전 조회 4,095
17년 전 조회 2,257
17년 전 조회 2,353
17년 전 조회 1,402
17년 전 조회 2,519
17년 전 조회 2,207
17년 전 조회 2,966
17년 전 조회 2,474
17년 전 조회 1,639
17년 전 조회 2,431
17년 전 조회 1,588
17년 전 조회 1,174
17년 전 조회 2,235
17년 전 조회 2,880
🐛 버그신고