1. 程式人生 > >電力項目十三--js添加highslider特效

電力項目十三--js添加highslider特效

fixed cnblogs lose Coding class expand tty onclick utf

當頁面的一個table表格無法顯示所有的內容的時候,點擊【查看詳細信息】,顯示詳細內容:

下載css,js

1.在actingIndex.jsp中添加:引入js和css:

<LINK href="${pageContext.request.contextPath }/css/openView.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="${pageContext.request.contextPath }/script/highslide/highslide.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath }/script/highslide/highslide-html.js"></script>

2.添加javascript

  <script type="text/javascript">    
        hs.graphicsDir = ‘${pageContext.request.contextPath }/script/highslide/graphics/‘;
        hs.outlineType = ‘rounded-white‘;
        hs.outlineWhileAnimating = true;
  </script>

3.actingIndex.jsp頁面中添加代碼

<div>
                                                <a style="CURSOR:hand" href="${pageContext.request.contextPath }/system/elecCommonMsgAction_actingView.do?" onclick="return hs.htmlExpand(this, { contentId: ‘highslide-html-1‘, objectType: ‘ajax‘, preserveContent: true} )">
                                                    <div class
="scrollStyle" align="left" style="table-layout:fixed;"> 查看設備詳細信息 </div> </a> <div class
="highslide-html-content" id="highslide-html-1" style="width: 700px"> <div class="highslide-move" style="border: 0; height: 18px; padding: 2px; cursor: default"> <a href="#" onClick="return hs.close(this)" class="control">[關 閉]</a> </div> <div class="highslide-body"></div> </div> </div>

4.ElecCommonMsgAction.java

    //添加highslider特效
    public String actingView(){
        ElecCommonMsg commonMsg = elecCommonMsgService.findCommonMsg();
        ValueUtils.putValueStack(commonMsg);
        return "actingView";
    }

5.actingView.jsp頁面

<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<html>
<head>
    <title>顯示運行監控記錄</title>
    <LINK href="${pageContext.request.contextPath }/css/Style.css" type="text/css" rel="stylesheet">
</head>
<body>
    <table cellspacing="1" cellpadding="0" width="100%" align="center" bgcolor="#f5fafe" border="0">
        <TR height="10">
            <td class="ta_01">
                <s:property value="devRun"/>
            </td>
        </TR>
    </table>
    
</body>
</html>

電力項目十三--js添加highslider特效