$("選擇器").mouseover(function(e)
{
e.pageX(px);
e.pageY(px) ; //物件座標值
$("選擇器").append(元件);
});
$("選擇器").mouseout(function(e)
{
$("選擇器")..remove();
});
--------------
$("選擇器").);css({屬性1:屬性值1,屬性2:屬性值2,屬性3:屬性值3});
屬性群集
---------------------------
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無標題文件</title>
</head>
<script language="javascript" src="jquery-1.10.2.js"></script>
<script language="javascript">
$(document).ready(function()
{
$("a.tooltip").mouseover(function(e)
{
var tp="<div id='tooltip' ><img src='image/a12.jpg' width=500 height=450 /></div>";
$("body").append(tp);
$("#tooltip").css({"top":e.pageY+"px","left":e.pageX+"px" }).show();
});
$("a.tooltip").mouseout(function(e)
{
$("#tooltip").remove();
});
});
</script>
<body>
<a href="javascript:void();" class="tooltip">影像一</a>
</body>
</html>
沒有留言:
張貼留言