一个奇怪的win10疑难问题出错,不知道为什么会出错

一个奇怪的问题(关于js的按钮事件)
一个奇怪的问题(关于js的按钮事件)
下面的代码是用按钮的几个鼠标事件,模仿按钮的状态变化. 当鼠标在test1(正常按钮)上滑过及按下时,一切正常,每种效果都能看见. 当鼠标在test2(被设为disabled=true的按钮)多滑过几次后,浏览器就会提示js错误,请问这是为什么???如果滑过的速度比较慢,这个按钮就不会出错,多次快速滑过就会出错. 请教各位,有什么好的解决办法???&style&
.button{ border-top:outset 2 border-left:outset 2 border-right:outset 1px #e7 border-bottom:outset 1px #e7 background-color:#e7 filter:progid:DXImageTransform.Microsoft.gradient(enabled='ture',startColorstr='#ffffffff', endColorstr='#FFe0e4f2') }
.buttonover { border-top:outset 2px # border-left:outset 2px # border-right:outset 1px #e7 border-bottom:outset 1px #e7 background-color:#e7 filter:progid:DXImageTransform.Microsoft.gradient(enabled='ture',startColorstr='#FFe0e4f2', endColorstr='#ffffffff') }
.buttondown{ border-top:outset 2px # border-left:outset 2px # border-right:outset 1px #e7 border-bottom:outset 1px #e7 background-color:#e7 filter:progid:DXImageTransform.Microsoft.gradient(enabled='ture',startColorstr='#ffffffff', endColorstr='#FFe0e4f2') }
&input type=&button& value=&test1& class=&button& hidefocus=true&
&input type=&button& value=&test2& class=&button& disabled=true&
&script language=&javascript&&
//alert(document.event)
//window.event=
document.onmouseover=highlightB
document.onmousedown=highlightB
document.onmouseup=highlightB
document.onmouseout=highlightB
function ss(){alert(&ss&)}
function highlightButton() { if (&INPUT& == event.srcElement.tagName && event.srcElement.type == &button&){ event.srcElement.hideFocus = true if (event.type == &mouseover&){event.srcElement.className = &buttonover& ;} if (event.type == &mousedown&){event.srcElement.className = &buttondown& ;} if (event.type == &mouseout&){event.srcElement.className = &button& ;} if (event.type == &mouseup&){event.srcElement.className = &buttonover& ;} //if (event.type == &click&){} }
} &/script&
&提示:您可以先修改部分代码再运行
昵称: anytime521 &时间:
昵称: 蓝色雨点 &时间:
昵称: anytime521 &时间:
昵称: carontao &时间:
昵称: anytime521 &时间:一个奇怪的问题
编辑:www.fx114.net
本篇文章主要介绍了"一个奇怪的问题
0",主要涉及到一个奇怪的问题
0方面的内容,对于一个奇怪的问题
0感兴趣的同学可以参考一下。
我按照msdn中的例子在一个mfc&sdi程序中的CView类的OnSize函数中应用函数MoveWindow改变子控件的位置,但每次都会出错,不只那位大虾明白,请不吝赐教.谢了,先是不是程序一起动就出错?
那是因为在程序启动时就调用了OnSize,但这时你所要改变尺寸的控件还未创建,所以调用MoveWindow函数会出错。
你要设定一个变量:bool&bControlCreated=false;
使在OnSize函数中仅当该值为true时,才调用MoveWindow。
在程序中控件被正确创建后使该值为true就可以了。我也不知道,学习。我也觉得是这样,msdn怎么会有这样的例子.谢谢GZCompiler(编译器)&,这个方法估计不错
一、不得利用本站危害国家安全、泄露国家秘密,不得侵犯国家社会集体的和公民的合法权益,不得利用本站制作、复制和传播不法有害信息!
二、互相尊重,对自己的言论和行为负责。
本文标题:
本页链接:

我要回帖

更多关于 说也奇怪 不知道 的文章

 

随机推荐