리자

간단한 풍선도움말

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


<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,410
17년 전 조회 2,008
17년 전 조회 1,793
17년 전 조회 2,312
17년 전 조회 4,996
17년 전 조회 1,714
17년 전 조회 2,449
17년 전 조회 2,415
17년 전 조회 2,682
17년 전 조회 2,405
17년 전 조회 4,727
17년 전 조회 3,220
17년 전 조회 3,134
17년 전 조회 1,850
17년 전 조회 1,509
17년 전 조회 4,239
17년 전 조회 1,911
17년 전 조회 1,908
17년 전 조회 2,393
17년 전 조회 2,160
17년 전 조회 1,795
17년 전 조회 4,205
17년 전 조회 2,035
17년 전 조회 3,379
17년 전 조회 3,302
17년 전 조회 1,294
17년 전 조회 2,111
17년 전 조회 1,865
17년 전 조회 2,120
17년 전 조회 2,928
17년 전 조회 3,288
17년 전 조회 3,491
17년 전 조회 3,607
17년 전 조회 1,702
17년 전 조회 1,697
17년 전 조회 2,506
17년 전 조회 2,251
17년 전 조회 2,542
17년 전 조회 3,082
17년 전 조회 3,565
17년 전 조회 2,639
17년 전 조회 1,914
17년 전 조회 3,498
17년 전 조회 3,340
17년 전 조회 3,309
17년 전 조회 4,192
17년 전 조회 2,829
17년 전 조회 2,693
17년 전 조회 2,941
17년 전 조회 3,179
17년 전 조회 2,890
17년 전 조회 1,733
17년 전 조회 2,139
17년 전 조회 1,735
17년 전 조회 2,194
17년 전 조회 2,818
17년 전 조회 8,977
17년 전 조회 3,420
17년 전 조회 4,487
17년 전 조회 2,249
17년 전 조회 3,922
17년 전 조회 1,817
17년 전 조회 1,640
17년 전 조회 2,573
17년 전 조회 1,569
17년 전 조회 1,875
17년 전 조회 1,729
17년 전 조회 2,796
17년 전 조회 1,749
17년 전 조회 1,342
17년 전 조회 1,493
17년 전 조회 3,388
17년 전 조회 2,421
17년 전 조회 2,213
17년 전 조회 1,471
17년 전 조회 2,694
17년 전 조회 1,428
17년 전 조회 1,390
17년 전 조회 1,644
17년 전 조회 3,005
17년 전 조회 2,662
17년 전 조회 2,717
17년 전 조회 1,443
17년 전 조회 1,558
17년 전 조회 3,518
17년 전 조회 3,091
17년 전 조회 4,352
17년 전 조회 2,525
17년 전 조회 2,616
17년 전 조회 1,670
17년 전 조회 2,780
17년 전 조회 2,466
17년 전 조회 3,237
17년 전 조회 2,734
17년 전 조회 1,883
17년 전 조회 2,669
17년 전 조회 1,819
17년 전 조회 1,409
17년 전 조회 2,479
17년 전 조회 3,116