【发布时间】:2010-12-20 16:49:03
【问题描述】:
我的问题是,当我在 mouseover 上使用 fadeOut() 和在 mouseout() 上使用 fadeIn() 时(在 组件上),我没有得到我期望的结果。发生的情况是,有时当鼠标不在对象上时,我想要淡入淡出()的按钮只是在循环中不断淡入淡出,有时循环停止,有时不会。
在 mouseover 和 mouseout 中使用fadeOut 和fadeIn 的正确方法是什么?
代码如下:
comment.onmouseout = function() {mouseOut(comment);};
comment.onmouseover = function() {mouseOver(comment);};
comment 是一个基本的
function mouseOut(parent){
var children = parent.childNodes;
var i=0;
for(i=1;i<children.length;i++){
if(children.item(i).tagName=="INPUT"){
$(children.item(i)).fadeOut();
}
}
}
function mouseOver(parent){
var children = parent.childNodes;
var i=0;
for(i=1;i<children.length;i++){
if(children.item(i).tagName=="INPUT"){
$(children.item(i)).fadeIn();
}
}
}
【问题讨论】:
-
也发布您的相关 html..