1[img]http://dl.iteye.com/upload/attachment/614198/53fb0971-67d3-3266-bf90-c4fe0abf7a7f.png[/img]
2[img]http://dl.iteye.com/upload/attachment/614194/78c2b9d6-36ae-3127-9bf3-8a775d466563.png[/img]
很簡單的增删查改 , 無難度 ..
讓我糾結了一會的就是 .
圖2的公告标題的資訊 ,展示在首頁的内部公告裡面,并且滾動顯示 。
經過了糾結+百度+高人指點 ,肉山大魔王終于被我削了。
首頁jsp代碼:
<tr>
<td colspan="3" height="28" style="background-image:url(${pageContext.request.contextPath}/images/latest_bg.jpg);"><h3>内部公告:</h3>
<iframe height="28" id="gonggaoIframe" allowTransparency="true" name="gonggaoIframe" width="850px" scrolling="no"
src="${pageContext.request.contextPath }/systemmanage/NeiBuGongGaoAction!indexlist.action" frame></iframe>
</td>
</tr>
真想不到 這裡能用iframe解決 !! 學習了.
Action代碼:
//首頁滾動list
public String indexlist(){
initQueryList();
getCommonService().getSplitPageQueryByEntityBase("org.hi.systemmanage.neibugonggao.dao.ibatis3.NeiBuGongGao.selectCount", "org.hi.systemmanage.neibugonggao.dao.ibatis3.NeiBuGongGao.selectAll", queryResult);
returnPageURL = "/systemmanage/neibugonggao/IndexNeiBuGongGaoList.jsp";
return "dispatcher";
}
代碼就是平常經常用到的查詢結果集,
下面是滾動jsp的代碼:
<body style="margin: 4px; background-color: transparent;">
<div id=demo style="overflow: hidden; height: 30px; width: 800px;" align="left">
<table align=left cellpadding=0 cellspace=0 800">
<TBODY>
<tr>
<td id=demo1 valign=top>
<table width="800" style="line-height:22px;" align="center" cellpadding="1" cellspacing="1">
<tr>
<!--text-decoration: none;去掉超連結的下劃線
background-color: transparent 設定iframe背景透明
margin-right: 25px; 字之間的間距
font-size:12px; 字的大小
-->
<td>
<ws:iterator value="queryResult.resultMap" id="result" status="status">
<!-- ${status.index} --> ※
<a style="cursor: pointer;text-decoration: none;margin-right: 20px;" title="<ws:property value='#result.GGTITLE' />"
target="_blank" href="NeiBuGongGaoAction!view.action?vid=<ws:property value=" target="_blank" rel="external nofollow" #result.ID"/>">
<font color="red" ><ws:property value="#result.GGTITLE" /></font></a>
</ws:iterator>
</td>
</tr>
</table>
</td>
<td id=demo2 valign=top></td>
</tr>
</TBODY>
</table>
</div>
<!-- 滾動JS代碼 這個網上很多-->
<script>
var speed = 30
demo2.innerHTML = demo1.innerHTML
function Marquee() {
if (demo2.offsetWidth - demo.scrollLeft <= 0)
demo.scrollLeft -= demo1.offsetWidth
else {
demo.scrollLeft++
}
}
var MyMar = setInterval("Marquee()", speed);
demo.onmouseover = function() {
clearInterval(MyMar)
}
demo.onmouseout = function() {
MyMar = setInterval("Marquee()", speed);
}
</script>
</body>