展开全部
滑动门通用JSfunction scrollDoor(){
}
scrollDoor.prototype = {
sd : function(menus,divs,openClass,closeClass){
var _this = this;
if(menus.length != divs.length)
{
alert("菜单层数量e5a48de588b63231313335323631343130323136353331333264656132和内容层数量不一样!");
return false;
}
for(var i = 0 ; i < menus.length ; i++)
{
_this.$(menus[i]).value = i;
_this.$(menus[i]).onmouseover = function(){
for(var j = 0 ; j < menus.length ; j++)
{
_this.$(menus[j]).className = closeClass;
_this.$(divs[j]).style.display = "none";
}
_this.$(menus[this.value]).className = openClass;
_this.$(divs[this.value]).style.display = "block";
}
}
},
$ : function(oid){
if(typeof(oid) == "string")
return document.getElementById(oid);
return oid;
}
}
window.onload = function(){
var SDmodel = new scrollDoor();
SDmodel.sd(["m01","m02","m03","m04","m05"],["c01","c02","c03","c04","c05"],"sd01","sd02");
SDmodel.sd(["mm01","mm02","mm03","mm04","mm05"],["cc01","cc02","cc03","cc04","cc05"],"sd01","sd02");
SDmodel.sd(["mmm01","mmm02","mmm03","mmm04","mmm05"],["ccc01","ccc02","ccc03","ccc04","ccc05"],"sd01","sd02");
}
滑动门封装类
效果预览
- 滑动门
- 滑动门
- 滑动门
- 滑动门
- 滑动门
第一层内容
第二层内容
第三层内容
第四层内容
第五层内容
- 滑动门
- 滑动门
- 滑动门
- 滑动门
- 滑动门
第一层内容
第二层内容
第三层内容
第四层内容
第五层内容
- 滑动门
- 滑动门
- 滑动门
- 滑动门
- 滑动门
第一层内容
第二层内容
第三层内容
第四层内容
第五层内容
本回答由提问者推荐
已赞过
已踩过<
你对这个回答的评价是?
评论
收起