<!DOCTYPE html PUBLIC "
<head>
<meta http
<title>無標題文檔</title>
<script type="text/javascript" src="@public/js/jquery
<script type="text/javascript">
$(function(){
$
"changeTips":function(value){
value = $
divTip:""
}
var $this = $(this);
var indexLi =
//點擊document隱藏下拉層
$(document)
if($(event
var liVal = $(event
$this
blus();
}else{
blus();
}
})
//隱藏下拉層
function blus(){
$(value
}
//鍵盤上下執行的函數
function keychang(up){
if(up == "up"){
if(indexLi ==
indexLi = $(value
}else{
indexLi
}
}else{
if(indexLi == $(value
indexLi =
}else{
indexLi++;
}
}
$(value
}
//值發生改變時
function valChange(){
var tex = $this
var fronts = "";//存放含有“@”之前的字符串
var af = /@/;
var regMail = new RegExp(tex
//讓提示層顯示
if($this
blus();
}else{
$(value
show()
children()
each(function(index) {
var valAttr = $(this)
if(index==
//索引值大於
if(index>
//當輸入的值有“@”的時候
if(af
//如果含有“@”就截取輸入框這個符號之前的字符串
fronts = tex
$(this)
//判斷輸入的值“@”之後的值
if(regMail
$(this)
}else{
if(index>
$(this)
}
}
}
//當輸入的值沒有“@”的時候
else{
$(this)
}
}
})
}
}
//輸入框值發生改變的時候執行函數
if($
$(this)
valChange();
})
}else{
$(this)
valChange();
})
}
//鼠標點擊和懸停LI
$(value
hover(function(){
indexLi = $(this)
if($(this)
$(this)
}
})
//按鍵盤的上下移動LI的背景色
$this
if(event
keychang("up")
}else if(event
keychang()
}else if(event
var liVal = $(value
$this
blus();
}
})
}
})
$("#loginName")
divTip:"
});
})
</script>
<style type="text/css">
*{margin:
input{ width:
</style>
</head>
<body>
<div class="login">
<div class="ln"><input type="text" maxlength="
<ul class="on_changes">
<li email="">請選擇郵箱類型</li>
<li email=""></li>
<li email="@sina
<li email="@
<li email="@qq
<li email="@hotmail
<li email="@
<li email="@gmail
<li email="@yahoo
</ul>
</div>
</body>
</html>
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/19831.html