리자

간단한 풍선도움말

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


<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,363
17년 전 조회 1,965
17년 전 조회 1,740
17년 전 조회 2,265
17년 전 조회 4,951
17년 전 조회 1,674
17년 전 조회 2,411
17년 전 조회 2,369
17년 전 조회 2,647
17년 전 조회 2,360
17년 전 조회 4,681
17년 전 조회 3,181
17년 전 조회 3,096
17년 전 조회 1,807
17년 전 조회 1,461
17년 전 조회 4,193
17년 전 조회 1,868
17년 전 조회 1,871
17년 전 조회 2,343
17년 전 조회 2,112
17년 전 조회 1,744
17년 전 조회 4,167
17년 전 조회 1,988
17년 전 조회 3,334
17년 전 조회 3,259
17년 전 조회 1,251
17년 전 조회 2,067
17년 전 조회 1,826
17년 전 조회 2,074
17년 전 조회 2,891
17년 전 조회 3,250
17년 전 조회 3,457
17년 전 조회 3,563
17년 전 조회 1,665
17년 전 조회 1,657
17년 전 조회 2,460
17년 전 조회 2,213
17년 전 조회 2,501
17년 전 조회 3,044
17년 전 조회 3,519
17년 전 조회 2,602
17년 전 조회 1,875
17년 전 조회 3,457
17년 전 조회 3,302
17년 전 조회 3,268
17년 전 조회 4,145
17년 전 조회 2,790
17년 전 조회 2,655
17년 전 조회 2,904
17년 전 조회 3,142
17년 전 조회 2,849
17년 전 조회 1,687
17년 전 조회 2,101
17년 전 조회 1,708
17년 전 조회 2,154
17년 전 조회 2,774
17년 전 조회 8,938
17년 전 조회 3,382
17년 전 조회 4,446
17년 전 조회 2,214
17년 전 조회 3,882
17년 전 조회 1,783
17년 전 조회 1,600
17년 전 조회 2,543
17년 전 조회 1,537
17년 전 조회 1,836
17년 전 조회 1,691
17년 전 조회 2,760
17년 전 조회 1,724
17년 전 조회 1,315
17년 전 조회 1,464
17년 전 조회 3,348
17년 전 조회 2,393
17년 전 조회 2,185
17년 전 조회 1,436
17년 전 조회 2,654
17년 전 조회 1,396
17년 전 조회 1,346
17년 전 조회 1,598
17년 전 조회 2,964
17년 전 조회 2,625
17년 전 조회 2,684
17년 전 조회 1,406
17년 전 조회 1,524
17년 전 조회 3,479
17년 전 조회 3,056
17년 전 조회 4,315
17년 전 조회 2,491
17년 전 조회 2,581
17년 전 조회 1,638
17년 전 조회 2,743
17년 전 조회 2,431
17년 전 조회 3,198
17년 전 조회 2,698
17년 전 조회 1,847
17년 전 조회 2,630
17년 전 조회 1,787
17년 전 조회 1,375
17년 전 조회 2,444
17년 전 조회 3,078