java--项目开发的一些基本功能2

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" frameborder="0"></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 border=0 with="800">
<TBODY>
<tr>
<td id=demo1 valign=top>
<table width="800" style="line-height:22px;" border="0" 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="#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>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值