리자

간단한 풍선도움말

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


<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,164
16년 전 조회 1,740
16년 전 조회 1,507
16년 전 조회 2,041
16년 전 조회 4,726
16년 전 조회 1,413
17년 전 조회 2,148
17년 전 조회 2,132
17년 전 조회 2,402
17년 전 조회 2,149
17년 전 조회 4,429
17년 전 조회 2,930
17년 전 조회 2,864
17년 전 조회 1,599
17년 전 조회 1,240
17년 전 조회 3,945
17년 전 조회 1,615
17년 전 조회 1,611
17년 전 조회 2,109
17년 전 조회 1,880
17년 전 조회 1,495
17년 전 조회 3,918
17년 전 조회 1,755
17년 전 조회 3,130
17년 전 조회 3,008
17년 전 조회 1,039
17년 전 조회 1,848
17년 전 조회 1,591
17년 전 조회 1,851
17년 전 조회 2,639
17년 전 조회 3,022
17년 전 조회 3,216
17년 전 조회 3,326
17년 전 조회 1,461
17년 전 조회 1,418
17년 전 조회 2,251
17년 전 조회 1,974
17년 전 조회 2,288
17년 전 조회 2,814
17년 전 조회 3,263
17년 전 조회 2,364
17년 전 조회 1,631
17년 전 조회 3,205
17년 전 조회 3,071
17년 전 조회 3,045
17년 전 조회 3,914
17년 전 조회 2,587
17년 전 조회 2,405
17년 전 조회 2,656
17년 전 조회 2,895
17년 전 조회 2,611
17년 전 조회 1,454
17년 전 조회 1,895
17년 전 조회 1,487
17년 전 조회 1,911
17년 전 조회 2,509
17년 전 조회 8,696
17년 전 조회 3,156
17년 전 조회 4,243
17년 전 조회 1,983
17년 전 조회 3,661
17년 전 조회 1,554
17년 전 조회 1,385
17년 전 조회 2,322
17년 전 조회 1,315
17년 전 조회 1,630
17년 전 조회 1,462
17년 전 조회 2,531
17년 전 조회 1,500
17년 전 조회 1,089
17년 전 조회 1,224
17년 전 조회 3,099
17년 전 조회 2,162
17년 전 조회 1,969
17년 전 조회 1,215
17년 전 조회 2,449
17년 전 조회 1,169
17년 전 조회 1,128
17년 전 조회 1,376
17년 전 조회 2,740
17년 전 조회 2,394
17년 전 조회 2,479
17년 전 조회 1,177
17년 전 조회 1,296
17년 전 조회 3,244
17년 전 조회 2,830
17년 전 조회 4,097
17년 전 조회 2,259
17년 전 조회 2,355
17년 전 조회 1,404
17년 전 조회 2,522
17년 전 조회 2,208
17년 전 조회 2,968
17년 전 조회 2,479
17년 전 조회 1,639
17년 전 조회 2,432
17년 전 조회 1,590
17년 전 조회 1,176
17년 전 조회 2,237
17년 전 조회 2,883
🐛 버그신고