리자

간단한 풍선도움말

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


<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,475
17년 전 조회 2,078
17년 전 조회 1,847
17년 전 조회 2,380
17년 전 조회 5,064
17년 전 조회 1,760
17년 전 조회 2,504
17년 전 조회 2,478
17년 전 조회 2,749
17년 전 조회 2,470
17년 전 조회 4,794
17년 전 조회 3,298
17년 전 조회 3,201
17년 전 조회 1,919
17년 전 조회 1,579
17년 전 조회 4,307
17년 전 조회 1,984
17년 전 조회 1,979
17년 전 조회 2,463
17년 전 조회 2,212
17년 전 조회 1,856
17년 전 조회 4,278
17년 전 조회 2,088
17년 전 조회 3,442
17년 전 조회 3,368
17년 전 조회 1,356
17년 전 조회 2,161
17년 전 조회 1,926
17년 전 조회 2,182
17년 전 조회 2,980
17년 전 조회 3,343
17년 전 조회 3,545
17년 전 조회 3,660
17년 전 조회 1,760
17년 전 조회 1,755
17년 전 조회 2,566
17년 전 조회 2,316
17년 전 조회 2,602
17년 전 조회 3,150
17년 전 조회 3,610
17년 전 조회 2,696
17년 전 조회 1,963
17년 전 조회 3,550
17년 전 조회 3,413
17년 전 조회 3,372
17년 전 조회 4,257
17년 전 조회 2,891
17년 전 조회 2,741
17년 전 조회 3,003
17년 전 조회 3,231
17년 전 조회 2,950
17년 전 조회 1,807
17년 전 조회 2,206
17년 전 조회 1,847
17년 전 조회 2,265
17년 전 조회 2,870
17년 전 조회 9,034
17년 전 조회 3,482
17년 전 조회 4,545
17년 전 조회 2,309
17년 전 조회 3,978
17년 전 조회 1,869
17년 전 조회 1,715
17년 전 조회 2,637
17년 전 조회 1,631
17년 전 조회 1,939
17년 전 조회 1,793
17년 전 조회 2,860
17년 전 조회 1,823
17년 전 조회 1,392
17년 전 조회 1,555
17년 전 조회 3,440
17년 전 조회 2,472
17년 전 조회 2,272
17년 전 조회 1,530
17년 전 조회 2,753
17년 전 조회 1,488
17년 전 조회 1,451
17년 전 조회 1,709
17년 전 조회 3,058
17년 전 조회 2,716
17년 전 조회 2,788
17년 전 조회 1,499
17년 전 조회 1,614
17년 전 조회 3,577
17년 전 조회 3,149
17년 전 조회 4,411
17년 전 조회 2,570
17년 전 조회 2,683
17년 전 조회 1,724
17년 전 조회 2,831
17년 전 조회 2,530
17년 전 조회 3,290
17년 전 조회 2,795
17년 전 조회 1,942
17년 전 조회 2,721
17년 전 조회 1,869
17년 전 조회 1,473
17년 전 조회 2,543
17년 전 조회 3,179