리자

간단한 풍선도움말

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


<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,216
17년 전 조회 1,799
17년 전 조회 1,567
17년 전 조회 2,096
17년 전 조회 4,786
17년 전 조회 1,477
17년 전 조회 2,203
17년 전 조회 2,181
17년 전 조회 2,458
17년 전 조회 2,204
17년 전 조회 4,486
17년 전 조회 2,990
17년 전 조회 2,934
17년 전 조회 1,653
17년 전 조회 1,300
17년 전 조회 4,014
17년 전 조회 1,676
17년 전 조회 1,675
17년 전 조회 2,169
17년 전 조회 1,946
17년 전 조회 1,568
17년 전 조회 3,978
17년 전 조회 1,815
17년 전 조회 3,192
17년 전 조회 3,062
17년 전 조회 1,093
17년 전 조회 1,907
17년 전 조회 1,663
17년 전 조회 1,910
17년 전 조회 2,694
17년 전 조회 3,087
17년 전 조회 3,272
17년 전 조회 3,378
17년 전 조회 1,522
17년 전 조회 1,479
17년 전 조회 2,311
17년 전 조회 2,034
17년 전 조회 2,355
17년 전 조회 2,873
17년 전 조회 3,324
17년 전 조회 2,420
17년 전 조회 1,689
17년 전 조회 3,268
17년 전 조회 3,125
17년 전 조회 3,107
17년 전 조회 3,970
17년 전 조회 2,643
17년 전 조회 2,461
17년 전 조회 2,710
17년 전 조회 2,953
17년 전 조회 2,669
17년 전 조회 1,506
17년 전 조회 1,948
17년 전 조회 1,537
17년 전 조회 1,970
17년 전 조회 2,568
17년 전 조회 8,748
17년 전 조회 3,214
17년 전 조회 4,304
17년 전 조회 2,046
17년 전 조회 3,722
17년 전 조회 1,618
17년 전 조회 1,438
17년 전 조회 2,381
17년 전 조회 1,363
17년 전 조회 1,687
17년 전 조회 1,526
17년 전 조회 2,591
17년 전 조회 1,553
17년 전 조회 1,149
17년 전 조회 1,283
17년 전 조회 3,161
17년 전 조회 2,220
17년 전 조회 2,023
17년 전 조회 1,276
17년 전 조회 2,496
17년 전 조회 1,222
17년 전 조회 1,189
17년 전 조회 1,441
17년 전 조회 2,801
17년 전 조회 2,453
17년 전 조회 2,539
17년 전 조회 1,239
17년 전 조회 1,353
17년 전 조회 3,307
17년 전 조회 2,890
17년 전 조회 4,161
17년 전 조회 2,314
17년 전 조회 2,422
17년 전 조회 1,475
17년 전 조회 2,580
17년 전 조회 2,269
17년 전 조회 3,022
17년 전 조회 2,532
17년 전 조회 1,703
17년 전 조회 2,490
17년 전 조회 1,648
17년 전 조회 1,238
17년 전 조회 2,291
17년 전 조회 2,936