请问下,本论坛中的一个功能是如何实现的呢? onmouseover 弹出 div层或者用AJAX做 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <style type="text/css">.f{cursor:pointer;position:absolute;width:357px;height:194px;padding:15px 0 0 50px;background-image:url(http://static5.photo.sina.com.cn/middle/4ef69b3dg5785994300a4&000.jpg)}</style><script>var oo = truefunction create(){if(oo==true){oo=falsevar div =document.createElement("div")div.className="f"div.id="div"div.innerHTML="<a href='#'>大法师</a><br>山丘之王<br>血法师<br>怕拉丁"document.body.appendChild(div)document.getElementById("div").style.left=document.getElementById("text").offsetLeft+30document.getElementById("div").style.top=document.getElementById("text").offsetTopdiv.onmouseout=del}}function del(e){e=e||event;var obj=e.relatedTarget||e.toElement;var div =document.getElementById("div")if(div.contains(obj))return;document.body.removeChild(div)oo=true}</script><span id="text" onmouseover="create()" style="cursor:pointer;" onMouseOut="del()" >人族</span>写这么个例子真划算,基本上每个星期都有人问。。 效果貌似是出来了,可如果在DIV上显示动态的数据,貌似你上面的做法出不来吧~~ 纯js比较麻烦 一次就得把所有的数据全部读出来 好象没有网站这样去做了。。动态显示数据是ajax的范畴了,这个地方可写不出来,至少我写不出来。 jquery二维数组的使用方法? jquery 给span赋值问题 关于javascript连接socket与mysql的问题 一个 js问题 请教下 正则求连续数字 javascript中的函数调用问题 jquery 对this的操作 有些搞不明白 使用js滚动条换页 JS值调用的问题(想不通)......... 怎么样可以将导航条置于鼠标点击的坐标位置? 正则分隔字符 遍历数组中的对象属性
.f{
cursor:pointer;
position:absolute;
width:357px;
height:194px;
padding:15px 0 0 50px;
background-image:url(http://static5.photo.sina.com.cn/middle/4ef69b3dg5785994300a4&000.jpg)
}
</style>
<script>
var oo = true
function create(){
if(oo==true){
oo=false
var div =document.createElement("div")
div.className="f"
div.id="div"
div.innerHTML="<a href='#'>大法师</a><br>山丘之王<br>血法师<br>怕拉丁"
document.body.appendChild(div)
document.getElementById("div").style.left=document.getElementById("text").offsetLeft+30
document.getElementById("div").style.top=document.getElementById("text").offsetTop
div.onmouseout=del
}}function del(e){
e=e||event;
var obj=e.relatedTarget||e.toElement;
var div =document.getElementById("div")
if(div.contains(obj))return;
document.body.removeChild(div)
oo=true
}</script>
<span id="text" onmouseover="create()" style="cursor:pointer;" onMouseOut="del()" >人族</span>
写这么个例子真划算,基本上每个星期都有人问。。
动态显示数据是ajax的范畴了,这个地方可写不出来,至少我写不出来。