首页 新闻 搜索 专区 学院

ff下的奇怪现象

0
悬赏园豆:10 [已解决问题] 解决于 2008-08-18 17:29
<DL class=code> <DT>HTML code <DD><PRE><DIV><!-- Code highlighting produced by Actipro CodeHighlighter (freeware) http://www.CodeHighlighter.com/ --><SPAN style="COLOR: #0000ff">&lt;!</SPAN><SPAN style="COLOR: #ff00ff">DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">html </SPAN><SPAN style="COLOR: #ff0000">xmlns</SPAN><SPAN style="COLOR: #0000ff">="http://www.w3.org/1999/xhtml"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">head</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">head</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">body</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">script </SPAN><SPAN style="COLOR: #ff0000">type</SPAN><SPAN style="COLOR: #0000ff">="text/javascript"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">var</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> bb</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(){ document.onmouseup </SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">=</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5"> </SPAN><SPAN style="COLOR: #0000ff; BACKGROUND-COLOR: #f5f5f5">function</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">(){ alert(</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">1</SPAN><SPAN style="COLOR: #000000; BACKGROUND-COLOR: #f5f5f5">); }; } </SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">script</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">div </SPAN><SPAN style="COLOR: #ff0000">style</SPAN><SPAN style="COLOR: #0000ff">="width:100px;height:100px;background-color:#000000;"</SPAN><SPAN style="COLOR: #ff0000"> onmousedown</SPAN><SPAN style="COLOR: #0000ff">="bb()"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">div</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">&lt;</SPAN><SPAN style="COLOR: #800000">div </SPAN><SPAN style="COLOR: #ff0000">style</SPAN><SPAN style="COLOR: #0000ff">="width:100px;height:100px;background-color:#FF0000;"</SPAN><SPAN style="COLOR: #ff0000"> onmousedown</SPAN><SPAN style="COLOR: #0000ff">="bb()"</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000">123</SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">div</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">body</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN><SPAN style="COLOR: #000000"> </SPAN><SPAN style="COLOR: #0000ff">&lt;/</SPAN><SPAN style="COLOR: #800000">html</SPAN><SPAN style="COLOR: #0000ff">&gt;</SPAN></DIV> </PRE></DD></DL><BR><BR>&nbsp;<BR>当点住下面的div不放,并拖到浏览器外再放开会触发onmouseup <BR>但上面的div就会没有反应
cloudgamer的主页 cloudgamer | 菜鸟二级 | 园豆:280
提问于:2008-08-08 13:51
< >
分享
最佳答案
0
FF3没有发现问题 顺便提个问题,不要像你这个样子定义,最好使用 function bb(){document.onmouseup=function(){alert(0);}} 而且你这个好像有些地方逻辑不对,只要在这两个div中任何一个发生了onmousedown事件之后,无论在页面什么地方点鼠标,放开鼠标时都会触发那个事件
丁学 | 专家六级 |园豆:18530 | 2008-08-08 15:21
其他回答(1)
0
Jared.Nie | 园豆:1940 (小虾三级) | 2008-08-09 08:33
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册