리자

간단한 풍선도움말

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


<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,176
17년 전 조회 1,756
17년 전 조회 1,525
17년 전 조회 2,057
17년 전 조회 4,744
17년 전 조회 1,432
17년 전 조회 2,164
17년 전 조회 2,146
17년 전 조회 2,417
17년 전 조회 2,166
17년 전 조회 4,450
17년 전 조회 2,947
17년 전 조회 2,885
17년 전 조회 1,617
17년 전 조회 1,257
17년 전 조회 3,961
17년 전 조회 1,632
17년 전 조회 1,626
17년 전 조회 2,127
17년 전 조회 1,902
17년 전 조회 1,515
17년 전 조회 3,932
17년 전 조회 1,771
17년 전 조회 3,148
17년 전 조회 3,021
17년 전 조회 1,051
17년 전 조회 1,865
17년 전 조회 1,610
17년 전 조회 1,863
17년 전 조회 2,655
17년 전 조회 3,039
17년 전 조회 3,233
17년 전 조회 3,343
17년 전 조회 1,478
17년 전 조회 1,433
17년 전 조회 2,271
17년 전 조회 1,994
17년 전 조회 2,305
17년 전 조회 2,832
17년 전 조회 3,279
17년 전 조회 2,376
17년 전 조회 1,650
17년 전 조회 3,220
17년 전 조회 3,083
17년 전 조회 3,060
17년 전 조회 3,926
17년 전 조회 2,603
17년 전 조회 2,425
17년 전 조회 2,674
17년 전 조회 2,912
17년 전 조회 2,628
17년 전 조회 1,468
17년 전 조회 1,915
17년 전 조회 1,507
17년 전 조회 1,930
17년 전 조회 2,525
17년 전 조회 8,709
17년 전 조회 3,169
17년 전 조회 4,263
17년 전 조회 1,998
17년 전 조회 3,674
17년 전 조회 1,572
17년 전 조회 1,401
17년 전 조회 2,341
17년 전 조회 1,328
17년 전 조회 1,648
17년 전 조회 1,480
17년 전 조회 2,547
17년 전 조회 1,516
17년 전 조회 1,106
17년 전 조회 1,239
17년 전 조회 3,117
17년 전 조회 2,179
17년 전 조회 1,987
17년 전 조회 1,231
17년 전 조회 2,461
17년 전 조회 1,185
17년 전 조회 1,143
17년 전 조회 1,394
17년 전 조회 2,760
17년 전 조회 2,408
17년 전 조회 2,496
17년 전 조회 1,197
17년 전 조회 1,317
17년 전 조회 3,258
17년 전 조회 2,847
17년 전 조회 4,115
17년 전 조회 2,275
17년 전 조회 2,373
17년 전 조회 1,423
17년 전 조회 2,541
17년 전 조회 2,224
17년 전 조회 2,985
17년 전 조회 2,497
17년 전 조회 1,654
17년 전 조회 2,450
17년 전 조회 1,606
17년 전 조회 1,191
17년 전 조회 2,250
17년 전 조회 2,898