label显示一段数据,由于数据量过大,所以我截取了前200位,后面的用...代替了!!现在问题是怎么让鼠标放在省略号上,使全文显示..求高人真不会

解决方案 »

  1.   

    加<div title="全标题">..label..</div>
      

  2.   

    给你lable标签的 tooltip属性绑上你数据库的完整的数据  即可
      

  3.   

    给你个方法
    三个lable
    lable1 显示前两百子,
    lable2显示三个点
    lable3显示全文并且隐藏
    当鼠标房到lable2上的时候触发事件
    隐藏前两个lable 显示第三个lable
      

  4.   

    此方法如果在绑定的数据里面存在特殊字符,比如:+_)(*&^%$#@!,可能就无法完整的显示了,比较同意6楼的方式,主要是利用DIV的DISPLAY属性和鼠标ONMOUSEOVER、ONMOUSEOUT事件去实现
      

  5.   

    加个弹出层,这种特效网上有的是,要是要求的浏览器兼容性高的话,就用jquery自带的例子里面的,还很漂亮
      

  6.   

    ToolTip="全文" label 属性
      

  7.   

    看出来了,简单的问题大家都争先恐后回答!
    这样会比较慢,用个快点的方法吧!
    <SCRIPT src="js/main.js"></SCRIPT><hr><br>
    <DIV id=dHTMLToolTip 
    style="Z-INDEX: 100; LEFT: 0px; VISIBILITY: hidden; WIDTH: 30px; POSITION: absolute; TOP: 0px; HEIGHT: 10px"></DIV>
    <asp:imagebutton ID="img1" Runat=server ImageUrl="Images/wancheng.gif" onmouseover="showTooltip('dHTMLToolTip',event, '如果现在点击完成按钮,您的资<br>料将在以后进行完善,但这不影<br>响您在本站所拥有的功能。', '#F5FFC6', '#000000', '#000000', '8000')" onmouseout="hideTooltip('dHTMLToolTip')"></asp:imagebutton>
    调用JS
    <!-- 
    var tipTimer;
    function locateObject(n, d) {
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=locateObject(n,d.layers[i].document); return x;
    }
    function hideTooltip(object)
    {
    if (document.all)
    {
            locateObject(object).style.visibility="hidden"
            locateObject(object).style.left = 1;
            locateObject(object).style.top = 1;
    return false
    }
    else if (document.layers)
    {
            locateObject(object).visibility="hide"
            locateObject(object).left = 1;
            locateObject(object).top = 1;
            return false
    }
    else
            return true
    }
    function showTooltip(object,e, tipContent, backcolor, bordercolor, textcolor, displaytime)
    {
            window.clearTimeout(tipTimer)
            if (document.all)
                    {
                            locateObject(object).style.top=document.body.scrollTop+event.clientY+20                        locateObject(object).innerHTML='<table style="font-family: 宋体; font-size: 9pt; border: '+bordercolor+'; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; background-color: '+backcolor+'" width="10" border="0" cellspacing="1" cellpadding="1"><tr><td nowrap><font style="font-family: 宋体; font-size: 9pt; color: '+textcolor+'">'+unescape(tipContent)+'</font></td></tr></table> '                        if ((e.x + locateObject(object).clientWidth) > (document.body.clientWidth + document.body.scrollLeft))
                                    {
                                            locateObject(object).style.left = (document.body.clientWidth + document.body.scrollLeft) - locateObject(object).clientWidth-10;
                                    }
                            else
                            {
                            locateObject(object).style.left=document.body.scrollLeft+event.clientX
                            }
                    locateObject(object).style.visibility="visible"
                    tipTimer=window.setTimeout("hideTooltip('"+object+"')", displaytime);
                    return true;
                    }
            else if (document.layers)
                    {
                    locateObject(object).document.write('<table width="10" border="0" cellspacing="1" cellpadding="1"><tr bgcolor="'+bordercolor+'"><td><table width="10" border="0" cellspacing="0" cellpadding="2"><tr bgcolor="'+backcolor+'"><td nowrap><font style="font-family: 宋体; font-size: 9pt; color: '+textcolor+'">'+unescape(tipContent)+'</font></td></tr></table></td></tr></table>')
                    locateObject(object).document.close()
                    locateObject(object).top=e.y+20                if ((e.x + locateObject(object).clip.width) > (window.pageXOffset + window.innerWidth))
                            {
                                    locateObject(object).left = window.innerWidth - locateObject(object).clip.width-10;
                            }
                    else
                            {
                            locateObject(object).left=e.x;
                            }
                    locateObject(object).visibility="show"
                    tipTimer=window.setTimeout("hideTooltip('"+object+"')", displaytime);
                    return true;
            }
            else
            {
                    return true;
            }
    }
    //-->
      

  8.   


    方法上面有很多,自我感觉这个简单,挺好,TOOLTip也行,看要求了