求救啊 这个js效果怎么实现 http://shopping.naver.com/ 页面左上 的那个js效果啊 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <!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=gb2312" /><title>test</title><script type="text/javascript"> function Show(sender) { document.getElementById("test").style.display = "block"; var leftpos = 0,toppos = 0; var pObject = sender.offsetParent; if (pObject) { leftpos += pObject.offsetLeft; toppos += pObject.offsetTop; } while(pObject=pObject.offsetParent ) { leftpos += pObject.offsetLeft; toppos += pObject.offsetTop; }; document.getElementById("test").style.left = (sender.offsetLeft + leftpos) + "px"; document.getElementById("test").style.top = (sender.offsetTop + toppos + sender.offsetHeight - 2) + "px"; } function Hide(sender) { document.getElementById("test").style.display = "none"; }</script></head><body><a href="#" onmousemove="Show(this)" onmouseout="Hide(this)">onmouseover</a><div id="test" style="position: absolute; border-right: #a5a5a5 1px solid; padding-right: 10px; border-top: #a5a5a5 1px solid; padding-left: 15px; padding-bottom: 12px; border-left: #a5a5a5 1px solid; width: 300px; padding-top: 12px; border-bottom: #a5a5a5 1px solid; background-color: #ffffff; display: none" onmouseover="this.style.display='block'" onmouseout="this.style.display='none'">test<br />test<br />test<br />test<br />test<br />test<br />test<br />test</div></body></html> 和csdn这个一样,用ajax做就可以了 啊 啊 不要ajax撒 我不会啊 先说用js怎么弄啊 给你一个DIV的定位方法 function getInfo(o) {//取得坐标 var to=new Object(); to.left=to.right=to.top=to.bottom=0; var twidth=o.offsetWidth; var theight=o.offsetHeight; while(o!=document.body) { to.left+=o.offsetLeft; to.top+=o.offsetTop; o=o.parentElement; } to.right=to.left+twidth; to.bottom=to.top+theight; return to; }我在CSDN上发了一个资源,叫拖动购物车,上面有在列表边加载产品信息的方法建议你看一下,不过最好在51aspx 上去下,51aspx把我的资源转载了,也把数据库加上去了 求一个javascript 移动div层的效果代码 代码简单的 我学习用 求一个正则表达,实现如下功能 JS文件一放到页面里面,字与字之间的距离就变了 如何控制弹出窗口地位置 在线等~! 很菜的下拉框问题,救急!!!! 如何在JS中类似AOP那样,在所有方法开始前和结束后调用某个方法? 高分求救: 模态窗口不执行javascript? 请问js中有没有3个按钮的对话框? 谁有这样的东东:一个输入框这边有个按钮,点击按钮可以出现像做图工具一样的色彩选择器,点击一个颜色,它的值就会赋给输入框? javascript判断客户端文件大小. 在frame上如何实现遮罩效果?
<!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=gb2312" />
<title>test</title>
<script type="text/javascript">
function Show(sender)
{
document.getElementById("test").style.display = "block";
var leftpos = 0,toppos = 0;
var pObject = sender.offsetParent;
if (pObject)
{
leftpos += pObject.offsetLeft;
toppos += pObject.offsetTop;
}
while(pObject=pObject.offsetParent )
{
leftpos += pObject.offsetLeft;
toppos += pObject.offsetTop;
}; document.getElementById("test").style.left = (sender.offsetLeft + leftpos) + "px";
document.getElementById("test").style.top = (sender.offsetTop + toppos + sender.offsetHeight - 2) + "px"; }
function Hide(sender)
{
document.getElementById("test").style.display = "none";
}
</script>
</head><body>
<a href="#" onmousemove="Show(this)" onmouseout="Hide(this)">onmouseover</a>
<div id="test" style="position: absolute; border-right: #a5a5a5 1px solid;
padding-right: 10px; border-top: #a5a5a5 1px solid; padding-left: 15px; padding-bottom: 12px;
border-left: #a5a5a5 1px solid; width: 300px; padding-top: 12px; border-bottom: #a5a5a5 1px solid;
background-color: #ffffff; display: none" onmouseover="this.style.display='block'"
onmouseout="this.style.display='none'">test<br />test<br />test<br />test<br />test<br />test<br />test<br />test</div>
</body>
</html>
function getInfo(o)
{//取得坐标
var to=new Object();
to.left=to.right=to.top=to.bottom=0;
var twidth=o.offsetWidth;
var theight=o.offsetHeight;
while(o!=document.body)
{
to.left+=o.offsetLeft;
to.top+=o.offsetTop;
o=o.parentElement;
}
to.right=to.left+twidth;
to.bottom=to.top+theight;
return to;
}
我在CSDN上发了一个资源,叫拖动购物车,上面有在列表边加载产品信息的方法
建议你看一下,不过最好在51aspx 上去下,51aspx把我的资源转载了,也把数据库加上去了