这样 还是原来那样差不多。 建议title=“XX”
改成一个div标签 title 模式在某些浏览器是显示不正常的!
参考一下这个- <script type="text/javascript">
- function callmydiv(){
- var F = this;
- F.onclick = function (e){var s = e ? e.currentTarget :window.event.srcElement;if(s.tagName == 'A'){location.href = s.href;}else if(s==this){location.href = s.children[1]}}
- F.onmouseout = function (e){var F = this,b = $(F.id +'_menu');b['style']['display'] = 'none';}
- F.onmousemove = function (e){
- var F = this,b = $(F.id +'_menu'),c=document.documentElement,d=document.body,e = e||window.event,sc = e.currentTarget ? e.currentTarget : e.srcElement;
- if(sc && (sc.className =='y' || sc.c)){
- b['style']['display'] = 'none';
- return false;
- }
- Top = Math.max(c.scrollTop, d.scrollTop) + e.clientY;
- Left = Math.max(c.scrollLeft,d.scrollLeft) + e.clientX+15;
- b['style']['left'] =Left+'px';
- b['style']['top'] =Top+'px';
- b['style']['display'] = '';
- }
- F.onmouseover = function (e){e = e||window.event;this.onmousemove(e);}
- }
- var sigediv = document.getElementById('sige');
- var sigelis = sigediv.getElementsByTagName('li');
- for(var i=0;i<sigelis.length;i+=1){
- if(sigelis[i].getAttribute('s')=='1'){
- var F = sigelis[i],C = F.getElementsByTagName('div');
- F.id = "sige_"+i;
- if(C[0] && C[0].className =="show")
- C[0].id = "sige_"+i+"_menu";
- C[0].style.display = 'none';
- $('append_parent').appendChild(C[0]);
- F.onmouseover = callmydiv;
- }
-
- }
- </script>
复制代码 这个会遍历一个div id为“sige”的所有 li 标签
然后判断LI是否有 s='1' 标记
如果有 便获取li里面第一个div标签 且div标签为class="show" 然后执行浮动效果
参考
<li s="1" class="imglist">
<a href="XXX">
<img src="data/attachment/forum/threadcover/65/de/132.jpg" width="115" align="absmiddle"/><p>你地都系无胆匪类黎噶咯~等我威下先</p></a>
<div class="show">
【新回复】<br />
标题:你地都系无胆匪类黎噶咯~等我威下先<br />
版块:摄影天地<br />
发帖:黄炜祥<br />
时间:2011-6-5 10:38:34<br />
回复:小雪韵<br />
时间:2011-7-24 22:01:31<br />
浏览:1794<br />
回帖:20<br />
</div></li>
|