SELECT列表框提示

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
" http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
 <script>
//定义Popup
var oP=window.createPopup();
oP.document.body.style.background="beige";
//popup是否已显示
var oPShow=0;
var lineCharCount=20;
var lineCount=new Number(0);
var subLine=new String();
function showTitle(obj){
var h=event.offsetY;
var fontsize=(obj.style.fontSize==""?(obj.currentStyle.fontSize==""?"9":obj.currentStyle.fontSize):obj.style.fontSize);
fontsize=parseInt(fontsize)*1.6;
var l=parseInt(h/fontsize);
if(null!=obj.options[l]){
 lineCount=0;
 subLine=obj.options[l].text;
 
 oP.document.body.innerText="";
 do{
  if(subLine.length>lineCharCount){
   oP.document.body.innerHTML+=subLine.substr(0,lineCharCount)+"<br>";
   subLine=subLine.substr(lineCharCount,subLine.length-lineCharCount);
   lineCount+=1;
  }
 }while(subLine.length>lineCharCount)
oP.document.body.innerHTML+=subLine;
lineCount+=1;
len=lineCharCount*8;
oP.show(event.offsetX+20,event.offsetY+fontsize+5,len,lineCount*(fontsize+2),document.body);
oPShow=1;
}
}
function hideTitle(obj){
if(oPShow==1)oP.hide();
}
</script>
<title>无标题文档</title>
</head>
<body>
<form name="form1" method="post" action="">
  <div id=div1 style="overflow:auto;width:100px;">
    <select name=s1 size=7 style="width:120;height:60%" οnmοusemοve="showTitle(this);" οnmοuseοut="hideTitle(this);">
      <option>aaaaaaaaaaaaaaaaaaaaaa1
      <option>012345678901234567899876543210987654321074102589637410258963963258741096328574107896321450789632145098741236509874123650
      <option>cccccccccccccccccccccccc1
      <option>ddddddddddddddddddddddd1
      <option>eeeeeeeeeeeeeeeeeeeeeee1
      <option>fffffffffffffffffffffffffff1
    </select>
  </div>
 
</form>
</body>
</html>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值