function showSubCategory(){
$("#AllSort dt").mouseover(function(){
var newDiv=document.getElementById("EFF_div_"+this.id.substr(7));
this.className="curr";
if (newDiv){
newDiv.style.display="block";
return;
}else{
//var CLASS_NAME=($.browser.msie?($.browser.version>"7.0")?"class":"className":"class");
var CLASS_NAME=($.browser.msie)?"className":"class";
var newDiv_wrap=document.createElement("div");
newDiv_wrap.setAttribute(CLASS_NAME,"pop_wrap");
newDiv_wrap.setAttribute("id","EFF_div_"+this.id.substr(7))
var newDiv=document.createElement("div");
newDiv.setAttribute(CLASS_NAME,"pop");
newDiv_wrap.appendChild(newDiv);
newDiv.innerHTML=this.nextSibling.innerHTML;
this.parentNode.insertBefore(newDiv_wrap,this);
newDiv_wrap.style.display="block";
}
//test/
$(".pop_wrap").mouseover(function(){
$(this).css({"display":"block"});
this.nextSibling.className="curr";
}).bind("mouseleave",function(){
$(this).css({"display":"none"});
this.nextSibling.className="";
})
//test end/
}).bind("mouseleave",function(){
this.className=(this.nextSibling.className=="Dis")?"curr":"";
$(".pop_wrap").css({"display":"none"});
});
}地址如:www.52gudu.com/shopping/shopping.aspx

解决方案 »

  1.   

    打印一下alert(this.nextSibling.nodeType);//看下IE FF值一样么"?
      

  2.   

    nextSibling问题有可能出在这个位置, ff里空格是会被nextSibling当做一个元素遍历到的,比如<span></span> <span></span>这种情况,这样,你第一个span的nextSibling就是一个空格,没有className这样的属性,但是在ie里,没有这样的事.很难说谁对谁不对,看样子,好像是遇到这种情况了.
      

  3.   


    这样验证是最好了,s_liangchao1s很强大```
      

  4.   


    //test/        
            $(".pop_wrap").mouseover(function(){
                $(this).css({"display":"block"});
                var el=this.nextSibling;
                while(el.nodeType!=1){
                      el=el.nextSibling;     
                      if(!el) return;
                };
                el.className="curr";
            }).bind("mouseleave",function(){
                $(this).css({"display":"none"});
                var el=this.nextSibling;
                while(el.nodeType!=1){
                      el=el.nextSibling;     
                      if(!el) return;
                };
                el.className="";
            })
      

  5.   

    tdj sj srj srj srj srj rsj sr jsrj