<div id="appLinks">
<ul id="appLinks_list" class="nav">
<span id="appLink_csrname" class="ui-state-default csrname"><a onmouseover="onMouseOver()">eacuser</span>
<li id="appLink_chngpwd" class="ui-state-default chngpwd">Change Password</li>
<li id="appLink_about" rtlOrder="3"><a href="javascript:openAboutDialog();"><img src="${link.getContextPath()}${msg.get("icon.information")}" border="0px;" align="top">About</a></li>
<li id="appLink_logout" rtlOrder="2"><a href="$link.getContextPath()/logout.do"><img src="${link.getContextPath()}${msg.get("icon.logout")}" border="0px;" align="top">LogOut</a></li>
<li id="appLink_help" rtlOrder="1"><a target="eachelp" href="$msg.get("eac.helpPath")"><img src="${link.getContextPath()}${msg.get("icon.help")}" border="0px;" align="top">Help</a></li>
</span>
</ul>
</div>
<script>
$(document).ready(function(){
$(".csrname").mouseleave(function(){
//$('#appLink_chngpwd').hide();
$(".csrname li").css("display","none");
});
$(".csrname").mouseover(function(){
//$('#appLink_chngpwd').show();
$(".csrname li").css("display","block");
});
</script>
任何帮助将不胜感激
答案 0 :(得分:1)
您可以尝试仅通过CSS执行此操作,因为您需要编辑标记。
CSS
#appLinks_list ul {
position: absolute;
left: 0;
top:30px;
width: 60px;
list-style: none;
display: none;
}
#appLinks_list li:hover ul {
display: block;
background: #ccc
}
#appLinks_list li:hover {
background: #ccc
}
我刚刚添加了显示:hover
下拉列表的最小代码。
答案 1 :(得分:0)
据我所知,使用这样的代码。将div id替换为div id。
$( "#appLink_csrname" ).mouseover(function() {
$('#changepasswordDivId').show();
});
$( "#changepasswordDivId" ).click(function() {
$('#popup').show();// use facebox or fancy box code that you are using for popup here.
});
答案 2 :(得分:0)
我认为这是你的HTML代码,观看范围和标签的错误
<ul id="appLinks_list" class="nav">
<span id="appLink_csrname" class="ui-state-default csrname"><a href="#">eacuser</a>
<li id="appLink_chngpwd" class="ui-state-default chngpwd">Change Password</li>
<li id="appLink_about" rtlOrder="3"><a href="javascript:openAboutDialog();"><img src="${link.getContextPath()}${msg.get("icon.information")}" border="0px;" align="top">About</a></li>
<li id="appLink_logout" rtlOrder="2"><a href="$link.getContextPath()/logout.do"><img src="${link.getContextPath()}${msg.get("icon.logout")}" border="0px;" align="top">LogOut</a></li>
<li id="appLink_help" rtlOrder="1"><a target="eachelp" href="$msg.get("eac.helpPath")"><img src="${link.getContextPath()}${msg.get("icon.help")}" border="0px;" align="top">Help</a></li>
</span>
</ul>
然后
<script>
$(document).ready(function(){
$('.csrname').bind('mouseenter', function () {
$('.csrname', '#appLink_csrname').show()
}
$('.csrname').bind('mouseleave', function () {
$('.csrname', '#appLink_csrname').hide()
}
})
</script>