html二级菜单箭头怎么去掉,再次点击下箭头的时候怎么使二级菜单移除?

function combox(json){

var obj=$("#"+json.id);//保存下拉列表DIV控件

obj.children().hide();

//判断json参数是否传入了可选参数

var backgroundColor=json.backgroundColor==null ? "#e0e0e0": json.backgroundColor;

var fontSize=json.fontSize==null ? "14px": json.fontSize;

var fontFamily=json.fontFamily==null ? "黑体": json.fontFamily;

var color=json.color==null ? "#000000": json.color;

//var order=json.order==null ? "asc": json.order;

obj.css({

"height":json.height+"px",

"width":json.width+"px",

"background-color":backgroundColor,

"font-size":fontSize+"px",

"font-family":fontFamily,

"color":color,

"border-radius":"3px",

"border":"solid 1px #969696",

"box-shadow":"#444444 0 1px 1px 0",

"cursor":"pointer",

"-webkit-user-select":"none",

});

//向列表图层添加两个DIV

obj.append("

");

obj.append("

");

//设置新添DIV的CSS样式

var comboxLeft=$("#comboxLeft");

var comboxRight=$("#comboxRight");

var comboxIMG=$("#comboxIMG");

comboxLeft.css({

"height":"100%",

"width":"169px",

"float":"left",

"line-height":json.height+"px",

"text-indent":"10px",

"border-right":"solid 1px #969696",

"cursor":"pointer",

"-webkit-user-select":"none",

});

comboxRight.css({

"height":"100%",

"width":"30px",

"float":"left",

"cursor":"pointer",

"-webkit-user-select":"none",

});

//把左边DIV内容设成第一个选项的内容

comboxLeft.text(obj.children("a:eq(0)").text());

//给右边DIV添加图片

comboxRight.append("jiantou.png");

$("#comboxRight img").css({

"margin-top":"3px",

"margin-left":"3px"

})

//为下拉列表添加点击事件

obj.click(function(){

//删除弹出列表DIV图层

$("#comboxList").remove();

//添加弹出列表DIV图层

obj.after("

");

//获取combox顶点坐标

var x=obj.offset().top;

var y=obj.offset().left;

//设置弹出列表DIV图层位置及样式

$("#comboxList").css({

"position":"absolute",

"top":y+json.height+"px",

"left":x+"px",

"z-index":1,

"width":json.width+"px",

"border-right":"solid 1px #969696",

"border-left":"solid 1px #969696",

"border-bottom":"solid 1px #969696",

"line-height":json.height+"px",

"text-indent":"10px",

"font-size":fontSize,

"cursor":"pointer",

"-webkit-user-select":"none",

});

//clone()克隆

$("#comboxList").append(obj.children("a").clone());//想弹出的列表项添加内容

//$("$comboxList").children("a").show();//显示A标签

//姜a标签设置成block模型

$("#comboxList").children("a").css({

"display":"block"

});

//为列表项添加点击事件

$("#comboxList").children("a").click(function(){

$("#comboxLeft").text($(this).text());

//删除列表图层

$("#comboxList").remove();

});

//为鼠标添加移入事件

$("#comboxList").children("a").mouseover(function(){

$(this).css({

"background-color":"#f0f0f0",

});

});

//为鼠标添加移出事件

$("#comboxList").children("a").mouseout(function(){

$(this).css({

"background-color":"#ffffff",

});

});

});

$(document).click(function(event){

var id=event.target.id;

if(id=="kungfo"||id=="comboxLeft"||id=="comboxRight"||id=="comboxIMG"){

return;

}else{

$("#comboxList").remove();

}

})

};

079f5fadeeb03694f0f3ff6fbf7d38e7.png

http://www.dreawer.com/question/29224d8a2c964e5da081f7e7ddd7ef44

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值