리자

간단한 풍선도움말

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


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

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

프로그램

+
제목 글쓴이 날짜 조회
17년 전 조회 2,371
17년 전 조회 1,974
17년 전 조회 1,750
17년 전 조회 2,271
17년 전 조회 4,960
17년 전 조회 1,677
17년 전 조회 2,419
17년 전 조회 2,374
17년 전 조회 2,654
17년 전 조회 2,371
17년 전 조회 4,691
17년 전 조회 3,185
17년 전 조회 3,104
17년 전 조회 1,818
17년 전 조회 1,467
17년 전 조회 4,197
17년 전 조회 1,872
17년 전 조회 1,878
17년 전 조회 2,353
17년 전 조회 2,119
17년 전 조회 1,756
17년 전 조회 4,176
17년 전 조회 1,993
17년 전 조회 3,342
17년 전 조회 3,265
17년 전 조회 1,257
17년 전 조회 2,071
17년 전 조회 1,836
17년 전 조회 2,081
17년 전 조회 2,896
17년 전 조회 3,259
17년 전 조회 3,465
17년 전 조회 3,575
17년 전 조회 1,669
17년 전 조회 1,665
17년 전 조회 2,470
17년 전 조회 2,220
17년 전 조회 2,511
17년 전 조회 3,051
17년 전 조회 3,530
17년 전 조회 2,610
17년 전 조회 1,884
17년 전 조회 3,465
17년 전 조회 3,310
17년 전 조회 3,278
17년 전 조회 4,159
17년 전 조회 2,796
17년 전 조회 2,662
17년 전 조회 2,913
17년 전 조회 3,150
17년 전 조회 2,856
17년 전 조회 1,699
17년 전 조회 2,110
17년 전 조회 1,711
17년 전 조회 2,163
17년 전 조회 2,778
17년 전 조회 8,947
17년 전 조회 3,387
17년 전 조회 4,456
17년 전 조회 2,221
17년 전 조회 3,890
17년 전 조회 1,788
17년 전 조회 1,606
17년 전 조회 2,551
17년 전 조회 1,543
17년 전 조회 1,848
17년 전 조회 1,700
17년 전 조회 2,766
17년 전 조회 1,733
17년 전 조회 1,323
17년 전 조회 1,473
17년 전 조회 3,358
17년 전 조회 2,396
17년 전 조회 2,192
17년 전 조회 1,440
17년 전 조회 2,659
17년 전 조회 1,403
17년 전 조회 1,353
17년 전 조회 1,610
17년 전 조회 2,976
17년 전 조회 2,637
17년 전 조회 2,692
17년 전 조회 1,414
17년 전 조회 1,530
17년 전 조회 3,485
17년 전 조회 3,065
17년 전 조회 4,322
17년 전 조회 2,499
17년 전 조회 2,589
17년 전 조회 1,644
17년 전 조회 2,753
17년 전 조회 2,440
17년 전 조회 3,210
17년 전 조회 2,704
17년 전 조회 1,857
17년 전 조회 2,643
17년 전 조회 1,795
17년 전 조회 1,380
17년 전 조회 2,448
17년 전 조회 3,081