关于Div的隐藏显示(求助啊!大侠们)

我想实现像,淘宝网的一个特效,就是当鼠标移动到大类别是,右边出来一个DIV层显示对应小类别,并且可以选择,我用repeat控件嵌套,然后用JQuery实现,结果就是每当一到小类别是 它就消失了(郁闷啊 !!!)我的代码如下请高手赐教!
(以下是Repeat生成的HTML代码)
<div id="type" onmouseover="shows(this)" onmouseout="hidediv(this)">
<div id="bigtype">服装服饰</div>
</div>
<div id="smalltype" onmouseover="shows2(this)" onmouseout="hidediv2(this)">

<div id="smalltypeinfo"><a href='#'>男装</a></div>

<div id="smalltypeinfo"><a href='#'>女装</a></div>

</div>

<div id="type" onmouseover="shows(this)" onmouseout="hidediv(this)">
<div id="bigtype">家用电器</div>
</div>
<div id="smalltype" onmouseover="shows2(this)" onmouseout="hidediv2(this)">

<div id="smalltypeinfo"><a href='#'>品牌电视</a></div>

<div id="smalltypeinfo"><a href='#'>吸尘器</a></div>

<div id="smalltypeinfo"><a href='#'>抽油烟机</a></div>

<div id="smalltypeinfo"><a href='#'>洗漱电器</a></div>

</div>

JS:
function getposOffset(what, offsettype) {
var totaloffset = (offsettype == "left") ? what.offsetLeft : what.offsetTop;
var parentEl = what.offsetParent;
while (parentEl != null) {
totaloffset = (offsettype == "left") ? totaloffset + parentEl.offsetLeft : totaloffset + parentEl.offsetTop;
parentEl = parentEl.offsetParent;
}
return totaloffset;
}
function show(obj, objdiv, addx, addy) {
var x = getposOffset(obj, 'left');
var y = getposOffset(obj, 'top');
$(objdiv).css("left", (x + addx) + 'px');
$(objdiv).css("top", (y + addy) + 'px');
$(objdiv).css("display", "block");
}
function shows(e) {
$(e).mousemove(function() {
var child = $(e).next();
show(e,$(e).next(), 143, -7);
})
}
function hidediv(e) {
$(e).mouseout(function() {
if (e) {
$(e).next().hide();
}
});
}
function shows2(e) {
var pr = $(e).prev();
show(pr,e, 143, -7);
}
function hidediv2(e) {
if (e) {
$(e).hide();
}
}
就是没当运行是 Js保存 郁闷了半天不知道是那点逻辑错了!!
请高手赐教!!!!!!!
还是报错!
******************最好能给俺一个完整的代码 我追加分数***********

第1个回答  2010-01-13
onmouseout="hidediv(this)"
要写在小类别的层中。。当鼠标移出小类别的层的时候隐藏
第2个回答  2010-01-09
var over = false;
function hidediv(e) {
$(e).mouseout(function() {
if (e && !over) {
$(e).next().hide();
}
});
}
function shows2(e) {
over = true;
var pr = $(e).prev();
show(pr,e, 143, -7);
}
function hidediv2(e) {
over = false;
if (e) {
$(e).hide();
}
}本回答被提问者采纳
第3个回答  2010-01-09
把大类中的 onmouseout="hidediv(this)" 去掉
第4个回答  2010-01-09
先把隐藏的语句去掉
相似回答