Hi,
This is more of a javascript question but I'll answer what I can.
You are asking for a tooltip to be displayed based on the title attribute of the option element. Therefore you need to ensure that you have all the title attributes in place in your option elements.
e.g.
Code:
<option title="This is the tooltip" value="SMA">SMA</option>
Then you need to comment out this section of the jquery because you are not using a tooltip div.
Code:
<script type="text/javascript">
$(document).ready(function() {
$("option[title]").tooltip({
// use div.tooltip as our tooltip
//tip: '.tooltip',
// use the fade effect instead of the default
effect: 'fade',
// make fadeOutSpeed similar to the browser's default
fadeOutSpeed: 100,
// the time before the tooltip is shown
predelay: 200,
// tweak the position
position: "right",
//offset: [18,5]
offset: [18,20]
});
});
</script>
That would seem to make the tooltip display ok. Hover over SMA and a tooltip will appear.
e.g.
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Untitled Document</title>
<script src="http://code.jquery.com/jquery-1.4.4.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script src="http://cdn.jquerytools.org/1.2.5/full/jquery.tools.min.js"></script>
<style type="text/css">
.tooltip {
display:none;
background-color:red;
border:1px solid black;
padding:3px;
FONT-FAMILY:Arial;
COLOR: blue;
font-size:13px;
width:300px;
box-shadow: 2px -2px 11px #666;
-moz-box-shadow: 2px -2px 11px #666;
-webkit-box-shadow: 2px -2px 11px #666;
border-radius:10px;
-moz-border-radius:10px;
-webkit-border-radius:10px;
/* For IE 8 */
-ms-filter: "progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#666')";
/* For IE 5.5 - 7 */
filter: progid:DXImageTransform.Microsoft.Shadow(Strength=4, Direction=135, Color='#666');
}
</style>
</head>
<body>
<form action="">
<div>
<select name="drop_1" id="drop_1">
<option value="" selected="selected" disabled="disabled">Select a Series</option>
<option value="N-Type">N-Type</option>
<option title="This is the tooltip" value="SMA">SMA</option>
<option value="SMB">SMB</option>
<option value="BNC">BNC</option>
<option value="TNC">TNC</option>
<option value="UHF">UHF</option>
<option value="SMC">SMC</option>
<option value="MMCX">MMCX</option>
<option value="MCX">MCX</option>
<option value="SSMB">SSMB</option>
<option value="HN">HN</option>
<option value="MiniUHF">MiniUHF</option>
<option value="SMP">SMP</option>
<option value="7/16">7/16</option>
<option value="1.0/2.3">1.0/2.3</option>
</select>
</div>
</form>
<script type="text/javascript">
$(document).ready(function() {
$("option[title]").tooltip({
// use div.tooltip as our tooltip
//tip: '.tooltip',
// use the fade effect instead of the default
effect: 'fade',
// make fadeOutSpeed similar to the browser's default
fadeOutSpeed: 100,
// the time before the tooltip is shown
predelay: 200,
// tweak the position
position: "right",
//offset: [18,5]
offset: [18,20]
});
});
</script>
</body>
</html>
If your question is how to add those tooltips to each select dynamically from the database then someone else will have to answer as I'm strictly CSS I'm afraid.
BTW make sure you use a valid doctype.
Bookmarks