리자

간단한 풍선도움말

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


<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,340
17년 전 조회 1,940
17년 전 조회 1,717
17년 전 조회 2,246
17년 전 조회 4,928
17년 전 조회 1,651
17년 전 조회 2,380
17년 전 조회 2,340
17년 전 조회 2,622
17년 전 조회 2,339
17년 전 조회 4,660
17년 전 조회 3,154
17년 전 조회 3,073
17년 전 조회 1,783
17년 전 조회 1,435
17년 전 조회 4,165
17년 전 조회 1,838
17년 전 조회 1,838
17년 전 조회 2,318
17년 전 조회 2,081
17년 전 조회 1,715
17년 전 조회 4,133
17년 전 조회 1,965
17년 전 조회 3,304
17년 전 조회 3,235
17년 전 조회 1,223
17년 전 조회 2,044
17년 전 조회 1,798
17년 전 조회 2,039
17년 전 조회 2,861
17년 전 조회 3,223
17년 전 조회 3,434
17년 전 조회 3,534
17년 전 조회 1,641
17년 전 조회 1,628
17년 전 조회 2,430
17년 전 조회 2,188
17년 전 조회 2,478
17년 전 조회 3,011
17년 전 조회 3,489
17년 전 조회 2,574
17년 전 조회 1,846
17년 전 조회 3,426
17년 전 조회 3,274
17년 전 조회 3,251
17년 전 조회 4,123
17년 전 조회 2,760
17년 전 조회 2,625
17년 전 조회 2,871
17년 전 조회 3,117
17년 전 조회 2,829
17년 전 조회 1,668
17년 전 조회 2,070
17년 전 조회 1,671
17년 전 조회 2,123
17년 전 조회 2,742
17년 전 조회 8,908
17년 전 조회 3,356
17년 전 조회 4,417
17년 전 조회 2,185
17년 전 조회 3,857
17년 전 조회 1,750
17년 전 조회 1,571
17년 전 조회 2,513
17년 전 조회 1,512
17년 전 조회 1,813
17년 전 조회 1,662
17년 전 조회 2,736
17년 전 조회 1,691
17년 전 조회 1,289
17년 전 조회 1,424
17년 전 조회 3,315
17년 전 조회 2,362
17년 전 조회 2,155
17년 전 조회 1,401
17년 전 조회 2,625
17년 전 조회 1,363
17년 전 조회 1,316
17년 전 조회 1,572
17년 전 조회 2,939
17년 전 조회 2,598
17년 전 조회 2,661
17년 전 조회 1,377
17년 전 조회 1,494
17년 전 조회 3,448
17년 전 조회 3,023
17년 전 조회 4,289
17년 전 조회 2,459
17년 전 조회 2,551
17년 전 조회 1,606
17년 전 조회 2,718
17년 전 조회 2,399
17년 전 조회 3,166
17년 전 조회 2,672
17년 전 조회 1,822
17년 전 조회 2,612
17년 전 조회 1,763
17년 전 조회 1,346
17년 전 조회 2,415
17년 전 조회 3,056