zl程序教程

您现在的位置是:首页 >  后端

当前栏目

处理jsp显示文字过长问题的解决方法

JSP方法 问题 处理 解决 显示 文字 过长
2023-06-13 09:14:47 时间
复制代码代码如下:

<tr>
   <tdheight="60px;"width="20%"align="right"valign="top">
     <fontstyle="font-weight:bold;">标题:</font>
    </td>
   <tdheight="60px;"width="80%"align="left"valign="top">
       <aid="span_content"href="#"style="color:white;"onmousemove="showdiv("span_div","",event)"onmouseover="showdiv("span_div","",event)"onmouseout="showdiv("span_div","none",event)">
   <c:iftest="${fn:length(schedule.contenteqnull?"无":schedule.content)>70}">${fn:substring(schedule.contenteqnull?"无":schedule.content,0,70)}...</c:if></a>
       <spanid="span_content_span"><c:iftest="${fn:length(schedule.contenteqnull?"无":schedule.content)<=70}">
       ${schedule.contentnull?"无":schedule.content}</c:if></span>
   </td>
    <divid="span_div"class="showDiv"style="display:none">
           ${schedule.contenteqnull?"无":schedule.content}
   </div>   
</tr>
<scripttype="text/javascript">
     functionshowdiv1(objstr,str,ev){//根据鼠标位置显示对象,参数ev为event
                   varObjX,ObjY;//对象的位置(x,y)
                   varmouseX=10;//对象的(x)水平位置距离鼠标的宽度
                   varmouseY=-2;//对象的(y)垂直位置距离鼠标的高度
                   varobj=document.getElementById(objstr);
                   obj.style.display=str;//显示或隐藏对象
                   obj.style.left="200px";
                   obj.style.top="110px";
               }
</script>