DVBBS ASP 垂直滚动公告

2014 年 11 月 3 日3190

买空间、服务器就上主机网(CNIDC.COM) 虚拟主机评测+IDC导航=主机之家。

只需要到后台,风格界面--》风格波板总管理--》page_index风格下的template.html(3)替换为下面的即可【建议先备份template.html(3)】:

以下为引用的内容:

<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://http://www.zjjv.com///1999/XSL/Transform" >
<xsl:output method="xml" omit-xml-declaration = "yes" indent="yes" version="4.0"/>
<!--
Copyright (C) 2004,2005 AspSky.Net. All rights reserved.
Written by dvbbs.net
Web: http://http://www.zjjv.com///,http://http://www.zjjv.com///
Email: eway@aspsky.net
论坛公告模板
-->
<xsl:variable name="maxposition" select="50"/><!--移动公告最多显示多少条-->
<xsl:variable name="show" select="1"/><!--方便不想显示公告的家伙,这里做了开关,设置为0则不显示公告-->
<xsl:template match="/">
<xsl:if test="$show=1">
<xsl:variable name="boardid" select="xml/@boardid"/>

<xsl:variable name="myscript1">
<![CDATA[
var anndelay = 3000;
var anncount = 0;var annheight = 36;var annst = 0;
function gid(id){return document.getElementById(id)};
function copydzOnover() {
if(!anncount) {clearTimeout(annst);annst = 0};
}
function copydzOnout() {
if(!annst) annst = setTimeout('copydzScroll()', anndelay);
}
function copydzScroll() {
if(!annst) {
gid("copydzbody").innerHTML += '<br style="clear: both" />' + gid("copydzbody").innerHTML;gid("copydzbody").scrollTop = 0;
if(gid("copydzbody").scrollHeight > annheight * 3) {
annst = setTimeout("copydzScroll()", anndelay);
} else {
gid("copydz").onmouseover = gid("copydz").onmouseout = null;
}
return;
}
if(anncount == annheight) {
if(gid("copydzbody").scrollHeight - annheight <= gid("copydzbody").scrollTop) {
gid("copydzbody").scrollTop = gid("copydzbody").scrollHeight / 2 - annheight;
}
anncount = 0;annst = setTimeout("copydzScroll()", anndelay);
} else {
gid("copydzbody").scrollTop++;anncount++;annst = setTimeout("copydzScroll()", 10);
}
}
]]>
</xsl:variable>
<xsl:variable name="myscript2">
<![CDATA[
copydzScroll();
]]>
</xsl:variable>

<xsl:choose>
<xsl:when test="xml/news[@boardid=$boardid]">
<style type="text/css">
#copydz ul{ margin-top: 0px; margin-bottom: 0px; }
#copydz li{ list-style: none; }
#copydz { text-align: left; line-height: 36px; height: 36px; overflow: hidden; }
#copydz div { text-align: left; border: 1px solid #FFF; padding: 0 0 0 0px; line-height: 35px !important; height: 36px; overflow-y: hidden;}
#copydz li { text-align: left; float: left; margin-right: 20px; padding-left: 20px; background: url(images/others/arrow_right.gif) no-repeat 0 50%; white-space: nowrap; }
#copydz li em { font-size: 0.83em; color: #666; }
</style>
<script type="text/javascript" language="javascript">
<xsl:value-of select="$myscript1" disable-output-escaping="yes" />
</script>
<div class="notice" id="copydz" onmouseover="copydzOnover()" onmouseout="copydzOnout()">
<div id="copydzbody"><ul>
<xsl:for-each select="xml/news[@boardid=$boardid][position() &lt; ($maxposition+1)]">
<li><a href="javascript:openScript('announcements.asp?boardid={$boardid}',500,400)"><xsl:value-of select="@title" disable-output-escaping="yes"/><em>(<xsl:value-of select="translate(@addtime,'T',' ')" />)</em></a></li>
</xsl:for-each>
</ul></div>
</div>
<script type="text/javascript" language="javascript">
<xsl:value-of select="$myscript2" disable-output-escaping="yes" />
</script>
</xsl:when>
<xsl:otherwise>
<!--没有公告-->
</xsl:otherwise>
</xsl:choose>

</xsl:if>
</xsl:template>
</xsl:stylesheet>

把下面文件放置images\others目录下:

arrow_right.gif:

更新缓存后即可实现效果。

ぐ逍遙づ玉ぷ

0 0