php drop down: show message on hover over list item
I have an drop down menu that is dynamically populated with php/mysql. I
have the following jquery set up to show/hide a div when a particular list
item is chosen (#other). What I want to do is to have some of the list
items show a popup message on hover, but I can't get it to happen. I have
the css set up already (shown below the jquery).
Do I attach a function to each list item name (tried but nothing happened,
probably because I'm not sure of the syntax)? I tried to edit the .change
function to a hover function, but the popup did not behave the way I had
hoped (hover made all the popups appear, or only worked on mouseout).
$(document).ready(function(){
$.enumList = {
'Brand name' : $([]),
'Cited' : $([]),
'Creator' : $([]),
'Descriptive' : $([]),
'Former' : $([]),
'Inscribed' : $([]),
'Owner' : $([]),
'Popular' : $([]),
'Repository' : $([]),
'Translated' : $([]),
'Other' : $('#other')
};
$('#selectEnum').change(function() {
// hide all
$.each($.enumList, function() { this.hide(); });
// show current
$.enumList[$(this).val()].show();
});
});
the css
#rPop, #tPop, #oPop {
background-color:#FFFFFF;
border:1px solid #999999;
cursor:default;
display:none;
margin-top: 15px;
position:relative;
text-align:left;
width:394px;
z-index:50;
padding: 25px 25px 20px;
}
No comments:
Post a Comment