dedecms5.6如何在首页代码用调用小说模块,下面我们根据代码片段分析一下。
代码片段:
<div id="demo" style="OVERFLOW: hidden; WIDTH: 100%; COLOR: #ffffff">
<table width="120" cellspacing="0" cellpadding="0" align="center" border="0" cellspace="0">
<tbody>
<tr>
<td id="demo1" valign="top">
<table width="110">
<tr>{dede:sql sql="Select bid,bookname,author,pubdate,body,litpic From dede_story_books order by bid desc limit 0,8"}
<td align="center">
<a href="/book/book.php?bid=[field:bid/]" target="_blank">
<img src="[field:litpic/]" alt="[field:bookname/]" border="0" / width="115" height="130"></a>
<li>
<a>
<strong>作 者:</strong>[field:author /]</a></li>
<li>
<a href="/book/book.php?bid=[field:bid/]" target="_blank">[field:bookname/]</a></li>
</td>{/dede:sql}</tr>
</table>
</td>
<td width="0" valign="top" id="demo2"></td>
</tr>
</tbody>
</table>
</div>
<script>var speed3 = 30 //速度数值越大速度越慢
demo2.innerHTML = demo1.innerHTML
function Marquee() {
if (demo2.offsetWidth – demo.scrollLeft <= 0) demo.scrollLeft -= demo1.offsetWidth
else {
demo.scrollLeft++
}
}
var MyMar = setInterval(Marquee, speed3) demo.onmouseover = function() {
clearInterval(MyMar)
}
demo.onmouseout = function() {
MyMar = setInterval(Marquee, speed3)
}</script>
以上代码可以直接插入到 首页 需要安放小说模块调用的地方,我的站将这部分安放在 图文资讯 栏目下方了。完整代码是在图文资讯下方插入
代码片段:
<div class="picnews">
<dl class="tbox light">
<dt class='light'>
<strong>图书连载</strong></dt>
<dd class='light'>
<div id="demo" style="OVERFLOW: hidden; WIDTH: 100%; COLOR: #ffffff">
<table width="120" cellspacing="0" cellpadding="0" align="center" border="0" cellspace="0">
<tbody>
<tr>
<td id="demo1" valign="top">
<table width="110">
<tr>{dede:sql sql="Select bid,bookname,author,pubdate,body,litpic From dede_story_books order by bid desc limit 0,8"}
<td align="center">
<a href="/book/book.php?bid=[field:bid/]" target="_blank">
<img src="[field:litpic/]" alt="[field:bookname/]" border="0" / width="115" height="130"></a>
<li>
<a>
<strong>作 者:</strong>[field:author /]</a></li>
<li>
<a href="/book/book.php?bid=[field:bid/]" target="_blank">[field:bookname/]</a></li>
</td>{/dede:sql}</tr>
</table>
</td>
<td width="0" valign="top" id="demo2"></td>
</tr>
</tbody>
</table>
</div>
<script>var speed3 = 30 //速度数值越大速度越慢
demo2.innerHTML = demo1.innerHTML
function Marquee() {
if (demo2.offsetWidth – demo.scrollLeft <= 0) demo.scrollLeft -= demo1.offsetWidth
else {
demo.scrollLeft++
}
}
var MyMar = setInterval(Marquee, speed3) demo.onmouseover = function() {
clearInterval(MyMar)
}
demo.onmouseout = function() {
MyMar = setInterval(Marquee, speed3)
}</script>
</dd>
</dl>
</div>
标签: dedecms建站, width, 代码, 片段, 首页
上面是“dedecms5.6如何在首页代码用调用小说模块”的全面内容,想了解更多关于 织梦cms 内容,请继续关注web建站教程。
当前网址:https://m.ipkd.cn/webs_709.html
声明:本站提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请发送到邮箱:admin@ipkd.cn,我们会在看到邮件的第一时间内为您处理!