38 123
发新话题
打印

[共享] 较仿800-MAILL 滾動浏览历史插件!

较仿800-MAILL 滾動浏览历史插件!

1).dwt

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
轉成
<!--DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"-->
1)pageheader 加
<script language="javascript" src="/themes/kids/js/history.js"></script>
2)內文加
/*if (countHistory() > 0)
{*/
document.write('' +
'<div id="LayerRightWing" style="width:63px; height:1px; position:relative; right:0px; top:0px; z-index:1;margin-top:0px;margin-left:5px;">' +
' <form name="RightGoodsListForm" method="post">' +
' <input type="hidden" name="f_up_no" value="-1">' +
' <input type="hidden" name="f_down_no" value="-1">' +
' <table width="63" border="0" cellspacing="0" cellpadding="0" align="center">' +
'   <tr>' +  
'  <td colspan="3" align="center" style="padding-bottom:6px;"><img src="../images/category_11.gif" border="0"></td>' +
'   </tr>' +
'   <tr>' +  
'  <td colspan="3" align="center"><img src="../images/category_19.gif" border="0"></td>' +
'   </tr>' +
'   <tr>' +  
'  <td colspan="3" align="center" style="background:#F3F3F3;padding-bottom:5px;border-left:1px solid #f3f3f3;border-right:1px solid #f3f3f3"><font color="#FF7900">(' + countHistory() +')</font></td>' +
'   </tr>' +
'   <tr>' +  
'  <td height="20" align="center" style="border-left:1px solid #f3f3f3;border-right:1px solid #f3f3f3"><a href="javascript:imgUp();"><img src="../images/category_22.gif" border="0"></a></td>' +
'   </tr>' +   
'   <tr>' +
'  <td align="center" style="border-left:1px solid #f3f3f3;border-right:1px solid #f3f3f3"><div id=firstTradeLeadsGoods></div></td>' +
'   </tr>' +
'    <tr>' +
'  <td align="center" style="border-left:1px solid #f3f3f3;border-right:1px solid #f3f3f3"><div id=secondTradeLeadsGoods></div></td>' +
'   </tr>' +
'    <tr>' +
'  <td align="center" style="border-left:1px solid #f3f3f3;border-right:1px solid #f3f3f3"><div id=thirdTradeLeadsGoods></div></td>' +
'   </tr>' +
'   <tr>' +
'  <td align="center" style="border-left:1px solid #f3f3f3;border-right:1px solid #f3f3f3"><div id=fourthTradeLeadsGoods></div></td>' +
'   </tr>' +
'   <tr>' +  
'  <td align="center" style="border-left:1px solid #f3f3f3;border-right:1px solid #f3f3f3;padding-bottom:10px;"><a href="javascript:imgDown();"><img src="../images/category_36.gif" border="0"></a></td>' +
'   </tr>' +
'   <tr>' +  
'  <td colspan="3" align="center"><a href="history.php"><img src="../images/category_43.gif" border="0"></a></td>' +
'   </tr>' +
' </table>' +  
' </form>' +  
'</div>');
/*}*/
</script>

<script type="text/javascript">
var v_goods = new Array();
var tmpDirectory = "";
var tmpCatalog = "";
var tmpKeyword = "";
var tempStr ;
var tp;
tempStr = getCookieHistory("HTR");
if (tempStr != '' && tempStr != null)
{
    v_goods = tempStr.split("|");
for (var m = 0; m < v_goods.length; m++)
{
  tp = v_goods[m].split("^");
  v_goods[m] = "<table width=48 cellspacing=0>"+
      "  <tr>"+
      "    <td align=center>"+
      "      <table width=100% cellspacing=1 bgcolor=#CCCCCC>"+
      "        <tr>"+
      "          <td align=center bgcolor=#FFFFFF>"+
      "            <a href="+ tp[1] +">"+
      "            <img src="+ tp[0] +" border=0 width=46 height=46>"+
      "            </a>"+
      "          </td>"+
      "        </tr>"+
      "      </table>"+
      "    </td>"+
      "  </tr>"+
      "  <tr>"+
      "    <td height=5></td>"+
      "  </tr>"+
      "</table>";

}
   
// Recently Trade Leads
var total_cycle = -1;
for (var i=0; i < v_goods.length; i++)
{
  if (i==0)
  {
   total_cycle++;
   if (v_goods != null)
    firstTradeLeadsGoods.innerHTML = v_goods;
   else
    firstTradeLeadsGoods.innerHTML = "";
  }
  
  if (i==1)
  {
   total_cycle++;
   if (v_goods != null)
    secondTradeLeadsGoods.innerHTML = v_goods;
   else
    secondTradeLeadsGoods.innerHTML = "";
  }
  
  if (i==2)
  {
   total_cycle++;
   if (v_goods != null)
    thirdTradeLeadsGoods.innerHTML = v_goods;
   else
    thirdTradeLeadsGoods.innerHTML = "";
  }
  
  if (i==3)
  {
   total_cycle++;
   if (v_goods != null)
    fourthTradeLeadsGoods.innerHTML = v_goods;
   else
    fourthTradeLeadsGoods.innerHTML = "";
  }
}

document.RightGoodsListForm.f_up_no.value = 0;
document.RightGoodsListForm.f_down_no.value = total_cycle;
}
function imgUp()
{
var nMinNo = parseInt(document.RightGoodsListForm.f_up_no.value);
if (nMinNo <= 0)
{
  alert("已经是最顶部!");
}
else
{
  var strText1 = v_goods[nMinNo - 1];
  var strText2 = v_goods[nMinNo];
  var strText3 = v_goods[nMinNo + 1];
  var strText4 = v_goods[nMinNo + 2];
  firstTradeLeadsGoods.innerHTML = strText1;
  secondTradeLeadsGoods.innerHTML = strText2;
  thirdTradeLeadsGoods.innerHTML = strText3;
  fourthTradeLeadsGoods.innerHTML = strText4;
  document.RightGoodsListForm.f_up_no.value = nMinNo-1;
  document.RightGoodsListForm.f_down_no.value = parseInt(document.RightGoodsListForm.f_down_no.value) - 1;
}
}
function imgDown()
{
var nMaxNo = parseInt(document.RightGoodsListForm.f_down_no.value);
var nMaxCnt = v_goods.length ;
if (nMaxNo >= nMaxCnt -1 || nMaxNo == -1)
{
  alert("已经是最底部!");
}
else
{
  var strText1 = v_goods[nMaxNo - 2];
  var strText2 = v_goods[nMaxNo - 1];
  var strText3 = v_goods[nMaxNo];
  var strText4 = v_goods[nMaxNo + 1];
  firstTradeLeadsGoods.innerHTML = strText1;
  secondTradeLeadsGoods.innerHTML = strText2;
  thirdTradeLeadsGoods.innerHTML = strText3;
  fourthTradeLeadsGoods.innerHTML = strText4;
  document.RightGoodsListForm.f_up_no.value = parseInt(document.RightGoodsListForm.f_up_no.value) + 1;
  document.RightGoodsListForm.f_down_no.value = nMaxNo + 1;
}
}
var isDOM = (document.getElementById ? true : false);
var isIE4 = ((document.all && !isDOM) ? true : false);
var isNS4 = (document.layers ? true : false);
var isNS = navigator.appName == "Netscape";
function getRef(id)
{
if (isDOM) return document.getElementById(id);
if (isIE4) return document.all[id];
if (isNS4) return document.layers[id];
}
function moveRightEdge()
{
var yMenuFrom, yMenuTo, yOffset, timeoutNextCheck;
if (isNS4)
{
  yMenuFrom   = divRight.top;
  yMenuTo     = windows.pageYOffset - 0;   
}
else if (isDOM)
{
  yMenuFrom   = parseInt (divRight.style.top, 10);
  yMenuTo     = (isNS ? window.pageYOffset : document.body.scrollTop) - 0;
}
timeoutNextCheck = 100;
if (yMenuFrom != yMenuTo)
{
  yOffset = Math.ceil(Math.abs(yMenuTo - yMenuFrom) / 10);
  if (yMenuTo < yMenuFrom)
   yOffset = -yOffset;
  if (isNS4)
   divRight.top += yOffset;
  else if (isDOM)
   divRight.style.top = parseInt (divRight.style.top, 10) + yOffset;
   timeoutNextCheck = 10;
}
setTimeout ("moveRightEdge()", timeoutNextCheck);
}

if (isNS4)
{
var divRight = document["LayerRightWing"];
// divRight.top = top.pageYOffset + 50;
divRight.visibility = "visible";
moveRightEdge();
}
else if (isDOM)
{
if (getRef('LayerRightWing') != null)
{
  var divRight = getRef('LayerRightWing');
//  divRight.style.top = (isNS ? window.pageYOffset : document.body.scrollTop) + 50;
  divRight.style.visibility = "visible";
  moveRightEdge();
}
}
function MM_openBrWindow(theURL,winName,features)
{ //v2.0
  window.open(theURL,winName,features);
}
</script>


[ 本帖最后由 mark1 于 2007-11-16 22:27 编辑 ]

附件

js.rar (7.96 KB)

2007-11-16 22:25, 下载次数: 350

history.gif (10.1 KB)

2007-11-16 22:25

history.gif

本帖最近评分记录
  • asher 体力 +5 谢谢楼主分享。。 2007-11-16 23:18

TOP

顶 不错~~~
收录下

TOP

郁闷,MARK 你咋等我WC的时候发布呢!!支持啊!!

TOP

不太清楚怎么做,.dwt这个是什么文件  是index.dwt吗?  2)內文加的代码是加到那个文件。

谢谢你的解答。

TOP

UP..
有人做好的放出来看一下。。
生日礼物-+ 礼品-+ 法藤-+ 别给我发PM。。

TOP

1).dwt

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
轉成
<!--DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"-->
1)pageheader 加
<script language="javascript" src="/themes/kids/js/history.js"></script>
2)內文加
/*if (countHistory() > 0)

这部分不太明白。。还请楼主指教。。谢谢

TOP

收了...先试试
动漫周边,模型,手办,人偶,Cosplay

TOP

在需要顯示的DWT 加上就可以.
EG index.dwt goods.dwt

TOP

引用:
原帖由 asher 于 2007-11-16 23:18 发表
UP..
有人做好的放出来看一下。。
http://www.800-mall.com/

TOP

收了...先试试

TOP

这个800MALL是谁做的啊

那个FLASH偶超喜欢 :lol

TOP

2)內文加
/*if (countHistory() > 0)
{*/
document.write('' +
'<div id="LayerRightWing" style="width:63px; height:1px; position:relative; right:0px; top:0px; z-index:1;margin-top:0px;margin-left:5px;">' +
' <form name="
……
…………
……
……

这些需要加在什么地方呢?
我加在goods.dwt文件的<body>...</body>中间怎么会解析不了呢?
麻烦楼主说明一下用法
谢谢

TOP

浏览记录一直为0
请教楼主怎么使用这个插件?
谢谢

TOP

不好意思, 請於GOODS.DWT 加上紅色CODE

                                            <!-- {if $goods.goods_img} -->
                                            <!-- 商品图片 -->
          <a href="{$goods.goods_img}" rel="lightbox[example]"><img src="{$goods.goods_img}" alt="{$goods.goods_name|escape:html}" width="380" class="thumb" />   
          <script language="Javascript">
   makeRecentHistory('{$goods.goods_img}','goods.php?id={$goods.goods_id}');
    </script>

                                            <!-- {/if} -->

TOP

支持一下

TOP

 38 123
发新话题