js京東ナビゲーション類を実現する欄
1607 ワード
function showSubCategory(){
$("#NavSort dt").mouseover(function(){
var newDiv=document.getElementById("NAV_div_"+this.id.substr(7));
this.className="curr";
alert(newDiv);
if (newDiv){
newDiv.style.display="block";
return;
}else{
var CLASS_NAME=($.browser.msie?($.browser.version>"8.0")?"class":"className":"class");
var newDiv_wrap=document.createElement("div");
newDiv_wrap.setAttribute(CLASS_NAME,"pop_wrap");
newDiv_wrap.setAttribute("id","NAV_div_"+this.id.substr(7))
var newDiv=document.createElement("div");
newDiv.setAttribute(CLASS_NAME,"pop");
newDiv_wrap.appendChild(newDiv);
newDiv.innerHTML=nextnode(this.nextSibling).innerHTML;
this.parentNode.insertBefore(newDiv_wrap,this);
newDiv_wrap.style.display="block";
}
$(".pop_wrap").mouseover(function(){
$(this).css({"display":"block"});
this.nextSibling.className="curr";
}).bind("mouseleave",function(){
$(this).css({"display":"none"});
this.nextSibling.className="";
})
}).bind("mouseleave",function(){
this.className=(this.nextSibling.className=="Dis")?"curr":"";
$(".pop_wrap").css({"display":"none"});
});
}