리자

간단한 풍선도움말

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


<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,158
16년 전 조회 1,735
16년 전 조회 1,500
16년 전 조회 2,034
16년 전 조회 4,722
16년 전 조회 1,406
16년 전 조회 2,141
16년 전 조회 2,123
17년 전 조회 2,393
17년 전 조회 2,139
17년 전 조회 4,426
17년 전 조회 2,923
17년 전 조회 2,858
17년 전 조회 1,593
17년 전 조회 1,231
17년 전 조회 3,936
17년 전 조회 1,610
17년 전 조회 1,601
17년 전 조회 2,100
17년 전 조회 1,873
17년 전 조회 1,489
17년 전 조회 3,911
17년 전 조회 1,748
17년 전 조회 3,120
17년 전 조회 3,001
17년 전 조회 1,032
17년 전 조회 1,842
17년 전 조회 1,583
17년 전 조회 1,844
17년 전 조회 2,634
17년 전 조회 3,018
17년 전 조회 3,211
17년 전 조회 3,318
17년 전 조회 1,454
17년 전 조회 1,411
17년 전 조회 2,244
17년 전 조회 1,967
17년 전 조회 2,284
17년 전 조회 2,805
17년 전 조회 3,259
17년 전 조회 2,357
17년 전 조회 1,627
17년 전 조회 3,199
17년 전 조회 3,065
17년 전 조회 3,040
17년 전 조회 3,907
17년 전 조회 2,580
17년 전 조회 2,401
17년 전 조회 2,651
17년 전 조회 2,889
17년 전 조회 2,606
17년 전 조회 1,448
17년 전 조회 1,891
17년 전 조회 1,484
17년 전 조회 1,908
17년 전 조회 2,504
17년 전 조회 8,689
17년 전 조회 3,149
17년 전 조회 4,237
17년 전 조회 1,979
17년 전 조회 3,654
17년 전 조회 1,548
17년 전 조회 1,380
17년 전 조회 2,318
17년 전 조회 1,311
17년 전 조회 1,624
17년 전 조회 1,455
17년 전 조회 2,523
17년 전 조회 1,491
17년 전 조회 1,084
17년 전 조회 1,218
17년 전 조회 3,094
17년 전 조회 2,158
17년 전 조회 1,966
17년 전 조회 1,209
17년 전 조회 2,444
17년 전 조회 1,166
17년 전 조회 1,124
17년 전 조회 1,365
17년 전 조회 2,729
17년 전 조회 2,386
17년 전 조회 2,472
17년 전 조회 1,173
17년 전 조회 1,288
17년 전 조회 3,238
17년 전 조회 2,824
17년 전 조회 4,091
17년 전 조회 2,250
17년 전 조회 2,347
17년 전 조회 1,397
17년 전 조회 2,516
17년 전 조회 2,203
17년 전 조회 2,960
17년 전 조회 2,471
17년 전 조회 1,633
17년 전 조회 2,425
17년 전 조회 1,585
17년 전 조회 1,173
17년 전 조회 2,233
17년 전 조회 2,878
🐛 버그신고