仿澳洲MSN首页的滑动商品展示(文件包已删除),方法如下:
1、将附件的js文件放进include\js文件夹中,css文件放进templates\softsea\css文件夹中。
2、在首页模板文件的head区添加如下句子:
<link rel="stylesheet" type="text/css" href="{S_URL}/templates/$_SCONFIG[template]/css/goods.css" />
<script src="{S_URL}/include/js/goods.js" type="text/javascript" language="javascript"></script>
3、在index.html.php里面找到如下代码:- <h3 id="goodstabs">
- <a id="newgoodstab" href="javascript:setTab('goods','newgoods');" class="tab curtab">最新商品</a>
- <a id="hotgoodstab" href="javascript:setTab('goods','hotgoods');" class="tab">热门商品</a>
- </h3>
- <div id="newgoods" class="tabcontent">
- <!--{block name="spacegoods" parameter="order/i.dateline DESC/limit/0,4/subjectlen/24/subjectdot/1/messagelen/60/messagedot/1/cachetime/15980/showdetail/1/cachename/newgoods/tpl/data"}-->
- <ul class="thumbmsglist">
- <!--{loop $_SBLOCK['newgoods'] $value}-->
- <li style="padding: 5px;">
- <p class="thumb"><a href="$value[url]"><img src="$value[thumb]" alt="$value[subjectall]" title="$value[subjectall]" /></a></p>
- <div style="width: 190px;">
- <h6><a href="$value[url]">$value[subject]</a></h6>
- <!--{if !empty($value[message])}--><p>$value[message]</p><!--{/if}-->
- </div>
- </li>
- <!--{/loop}-->
- </ul>
- </div>
- <div id="hotgoods" class="tabcontent" style="display: none;">
- <!--{block name="spacegoods" parameter="dateline/604800/order/i.replynum DESC/limit/0,4/subjectlen/30/subjectdot/1/messagelen/60/messagedot/1/showdetail/1/cachetime/33800/cachename/hotgoods/tpl/data"}-->
- <ul class="thumbmsglist">
- <!--{loop $_SBLOCK['hotgoods'] $value}-->
- <li style="padding: 5px;">
- <p class="thumb"><a href="$value[url]"><img src="$value[thumb]" alt="$value[subjectall]" title="$value[subjectall]" /></a></p>
- <div style="width: 190px;">
- <h6><a href="$value[url]">$value[subject]</a></h6>
- <!--{if !empty($value[message])}--><p>$value[message]</p><!--{/if}-->
- </div>
- </li>
- <!--{/loop}-->
- </ul>
- </div>
复制代码 用如下代码替换:- <SCRIPT type=text/javascript>
- if(typeof(init_shoppingAnim) == "function")
- NH.Util.attachEvent(window, "onload", init_shoppingAnim); //Needed to overcome a timing issue
- </SCRIPT>
- <NOSCRIPT><IMG height=1 alt="" src="http://beta.ninemsn.com.au/img/shopping/0.gif" width=1
- border=0> </NOSCRIPT>
- <DIV id=cat_hl_13154>
- <!--{block name="spacegoods" parameter="order/i.dateline DESC/limit/0,4/subjectlen/16/subjectdot/1/messagelen/40/messagedot/1/cachetime/15980/showdetail/1/cachename/newgoods/tpl/data"}-->
- <!--{loop $_SBLOCK['newgoods'] $value}-->
- <SPAN class=odd>
- <SPAN class=image><A onclick="AdTrack.t(this,'HL_NH_SHP_TAB1','1')" href="$value[url]">
- <img src="$value[thumb]" alt="$value[subjectall]" title="$value[subjectall]" align=middle border=0 width=40 height=40/>
- </A></SPAN>
- <SPAN class=title><A onclick="AdTrack.t(this,'HL_NH_SHP_TAB1','2')" href="$value[url]">$value[subject]</A></SPAN>
- <!--{if !empty($value[message])}-->
- <SPAN class=text>$value[message]</SPAN>
- <!--{/if}-->
- </SPAN>
- <!--{/loop}-->
- </DIV>
复制代码 说明:ie7完全正常,狐狸下面马马虎虎可以。ie6不知道如何。
请谨慎使用!!
[ 本帖最后由 jsaren 于 2007-10-16 19:15 编辑 ] |