JQ 特效下拉列表 写出与css一样的效果

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script src="../jquery-1.11.2.min.js"></script>
<style type="text/css">
*{ margin:0px auto; padding:0px}
#xiala{ width:150px}
#sel{ width:150px; height:25px; border:1px solid #666}
#sel:hover{ cursor:pointer}
#list{ width:150px; display:none}
.node{ width:150px; height:25px; background-color:#F6F; font-weight:bold; color:white; font-family:微软雅黑; text-align:center; line-height:25px; vertical-align:middle; border:1px solid #666; border-top:0px;}
.node:hover{ background-color:#69C; cursor:pointer}
</style>
</head> <body> <div id="xiala">
<div id="sel">所有</div>
<div id="list">
<div class="node">所有</div>
<div class="node">潘庄</div>
<div class="node">中关村</div>
<div class="node">火炬公园</div>
<div class="node">人民公园</div>
</div>
</div>
</body>
<script type="text/javascript">
$(document).ready(function(e) { //下拉列表
$("#sel").click(function(){
if($("#list").css("display")=="none")
{
$("#list").css("display","block");
}
else
{
$("#list").css("display","none");
} })
$(".node").click(function(){
var zhi = $(this).text();
$("#sel").text(zhi);
$("#list").css("display","none");
}) }); </script>
</html>
上一篇:Java 的 JSON 开源类库选择比较(zz)


下一篇:自定义actionbar标题