请问有什么办法能够让鼠标放到select上,可以让selected的文本显示出来,急!急!急! http://www.csdn.net/expert/topic/802/802480.xml?temp=.4789545要先disabled了才能显示title。其实selected的文本本来就能看得见啊。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 噢,是不是限制了宽度造成显示不完全啊,试试下面的:<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title></title></head><body><select onmouseout="hideTitle()" style="width:100" onmousemove="showTitle()"><option>aaaaaaaaaaaaaaaaaaaaaaaaaaa</option><option>bbbbbbbbbbbbbbbbbbbbbbbbbbb</option><option>ccccccccccccccccccccccccccc</option></select><select onmouseout="hideTitle()" style="width:100" onmousemove="showTitle()"><option>111111111111111111111111</option><option>22222222222222222222222</option><option>33333333333333333333333333</option></select><span style="display:none;position:absolute;background-color=#F8F9DF;" id=titleSpan></span><SCRIPT LANGUAGE="JavaScript"><!--function showTitle(){var elm = event.srcElement;titleSpan.innerText = elm.options[elm.selectedIndex].text;titleSpan.style.top=event.y+20titleSpan.style.left=event.x+20titleSpan.style.display="";}function hideTitle(){titleSpan.style.display="none";}//--></SCRIPT></body></html> 不知道span的style.border对象为什么没有用,只好用table来做边框了,同时调了一下颜色和字体,这回看起来更像title了呵呵。实际的title处理的是onmouseover事件,我故意用了onmousemove是因为个人爱好。<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title></title></head><body><select onmouseout="hideTitle()" style="width:100" onmousemove="showTitle()"><option>aaaaaaaaaaaaaaaaaaaaaaaaaaa</option><option>bbbbbbbbbbbbbbbbbbbbbbbbbbb</option><option>ccccccccccccccccccccccccccc</option></select><select onmouseout="hideTitle()" style="width:100" onmousemove="showTitle()"><option>111111111111111111111111</option><option>22222222222222222222222</option><option>33333333333333333333333333</option></select><table style="display:none;position:absolute;font-size:14" id=titleTable bgcolor=black cellspacing=1><td bgcolor=#FAFBEA></td></table><SCRIPT LANGUAGE="JavaScript"><!--function showTitle(){var elm = event.srcElement;titleTable.firstChild.firstChild.firstChild.innerText = elm.options[elm.selectedIndex].text;titleTable.style.top=event.y+20titleTable.style.left=event.xtitleTable.style.display="";}function hideTitle(){titleTable.style.display="none";}//--></SCRIPT></body></html> Firefox下怎么动态打开一个窗口,并且往窗口里加元素???? 关于mztreeview2.0的一个小问题 怎么把js文件弄成jsgz文件啊? 高手救命:为啥我加入外部的动态广告后老是出错? 用javascript向里面在加一个值怎么加啊(急) 请教关于 arguments 的问题? 求大神给个文本框的编辑器,带插入图片和表情的,类似发帖页面的这种 哪位达人知道HTML控件里name和id的区别? 一个类似csdn论坛的问题,不知道如果解决! 通过修改注册表来设置IE的代理服务器,能即时生效吗 showModalDialog传参数的简单问题 谁有类似的编辑器源码,高分求
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>
<body><select onmouseout="hideTitle()" style="width:100" onmousemove="showTitle()">
<option>aaaaaaaaaaaaaaaaaaaaaaaaaaa</option>
<option>bbbbbbbbbbbbbbbbbbbbbbbbbbb</option>
<option>ccccccccccccccccccccccccccc</option>
</select>
<select onmouseout="hideTitle()" style="width:100" onmousemove="showTitle()">
<option>111111111111111111111111</option>
<option>22222222222222222222222</option>
<option>33333333333333333333333333</option>
</select><span style="display:none;position:absolute;background-color=#F8F9DF;" id=titleSpan></span>
<SCRIPT LANGUAGE="JavaScript">
<!--
function showTitle()
{
var elm = event.srcElement;
titleSpan.innerText = elm.options[elm.selectedIndex].text;
titleSpan.style.top=event.y+20
titleSpan.style.left=event.x+20
titleSpan.style.display="";
}
function hideTitle()
{
titleSpan.style.display="none";
}
//-->
</SCRIPT>
</body>
</html>
实际的title处理的是onmouseover事件,我故意用了onmousemove是因为个人爱好。<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>
<body><select onmouseout="hideTitle()" style="width:100" onmousemove="showTitle()">
<option>aaaaaaaaaaaaaaaaaaaaaaaaaaa</option>
<option>bbbbbbbbbbbbbbbbbbbbbbbbbbb</option>
<option>ccccccccccccccccccccccccccc</option>
</select>
<select onmouseout="hideTitle()" style="width:100" onmousemove="showTitle()">
<option>111111111111111111111111</option>
<option>22222222222222222222222</option>
<option>33333333333333333333333333</option>
</select><table style="display:none;position:absolute;font-size:14" id=titleTable bgcolor=black cellspacing=1><td bgcolor=#FAFBEA></td></table>
<SCRIPT LANGUAGE="JavaScript">
<!--
function showTitle()
{
var elm = event.srcElement;
titleTable.firstChild.firstChild.firstChild.innerText = elm.options[elm.selectedIndex].text;
titleTable.style.top=event.y+20
titleTable.style.left=event.x
titleTable.style.display="";
}
function hideTitle()
{
titleTable.style.display="none";
}
//-->
</SCRIPT>
</body>
</html>