杭州神话信息技术有限公司

标题: 类似新浪侧边滚动的 常用导航 分享一下, [打印本页]

作者: csxiaorui    时间: 2011-6-6 20:07:14     标题: 类似新浪侧边滚动的 常用导航 分享一下,

[attach]2480[/attach][attach]2481[/attach]


此代码 加在 topic_foot.html  的</body>前面就行。

  1. <DIV id=xixi onmouseover=toBig() onmouseout=toSmall()>
  2. <TABLE style="FLOAT: left" border=0 cellSpacing=0 cellPadding=0 width=157>
  3.   <TBODY>
  4.   <TR>
  5.     <TD class=main_head height=39 vAlign=top> </TD></TR>
  6.   <TR>
  7.     <TD class=info vAlign=top>
  8.       <TABLE class=qqtable border=0 cellSpacing=0 cellPadding=0 width=120
  9.       align=center>
  10.         <TBODY><tr>
  11.           <TD height=5></TD></TR>
  12.    <TR><TD height=30 align=middle><A HREF="index.php?mod=tools&code=share"><span>分享到微博</span></A></TD></TR>
  13.    <TR><TD height=30 align=middle><A HREF="index.php?mod=show&code=show"><span>微博秀</span></A></TD></TR>
  14.    <TR><TD height=30 align=middle><A HREF="index.php?mod=tools&code=qqwb"><span>QQ微博</span></A></TD></TR>
  15.    <TR><TD height=30 align=middle><A HREF="index.php?mod=tools&code=imjiqiren"><span>QQ机器人</span></A></TD></TR>
  16.    <TR><TD height=30 align=middle><A HREF="index.php?mod=tools&code=sms"><span>短信</span></A></TD></TR>
  17.    <TR><TD height=30 align=middle><A HREF="index.php?mod=tools&code=sina"><span>新浪微博</span></A></TD></TR>
  18.    <TR><TD height=30 align=middle><A HREF="index.php?mod=settings&code=base"><span>我的资料</span></A></TD></TR>
  19.    <TR><TD height=30 align=middle><A HREF="index.php?mod=settings&code=user_medal"><span>我的勋章</span></A></TD></TR>
  20.    <TR><TD height=30 align=middle><A HREF="index.php?mod=settings&code=face"><span>我的头像</span></A></TD></TR>
  21.    <TR><TD height=30 align=middle><A HREF="index.php?mod=settings&code=secret"><span>修改密码</span></A></TD></TR>
  22.    <TR><TD height=30 align=middle><A HREF="index.php?mod=user_tag&code="><span>我的标签</span></A></TD></TR>
  23.    <TR><TD height=30 align=middle><A HREF="index.php?mod=settings&code=extcredits"><span>我的积分</span></A></TD></TR>
  24.         <TR>
  25.           <TD height=5></TD></TR>
  26.         </TBODY>
  27.         </TABLE>
  28.         </TD></TR>
  29.   <TR>
  30.     <TD class=down_kefu vAlign=top></TD></TR></TBODY></TABLE>
  31. <DIV class=Obtn></DIV></DIV>
  32. <SCRIPT language=javascript>
  33. 果果=function (id,_top,_left){
  34.                 var me=id.charAt?document.getElementById(id):id, d1=document.body, d2=document.documentElement;
  35.                 d1.style.height=d2.style.height='100%';me.style.top=_top?_top+'px':0;me.style.left=_left+"px";//[(_left>0?'left':'left')]=_left?Math.abs(_left)+'px':0;
  36.                 me.style.position='absolute';
  37.                 setInterval(function (){me.style.top=parseInt(me.style.top)+(Math.max(d1.scrollTop,d2.scrollTop)+_top-parseInt(me.style.top))*0.1+'px';},10+parseInt(Math.random()*20));
  38.                 return arguments.callee;
  39.                 };
  40.                 window.onload=function (){
  41. 果果
  42.                 ('xixi',100,-152)
  43.                 }
  44.         </SCRIPT>

  45. <SCRIPT language=javascript>
  46.                         lastScrollY=0;
  47.                        
  48.                         var InterTime = 1;
  49.                         var maxWidth=-1;
  50.                         var minWidth=-152;
  51.                         var numInter = 8;
  52.                        
  53.                         var BigInter ;
  54.                         var SmallInter ;
  55.                        
  56.                         var o =  document.getElementById("xixi");
  57.                                 var i = parseInt(o.style.left);
  58.                                 function Big()
  59.                                 {
  60.                                         if(parseInt(o.style.left)<maxWidth)
  61.                                         {
  62.                                                 i = parseInt(o.style.left);
  63.                                                 i += numInter;       
  64.                                                 o.style.left=i+"px";       
  65.                                                 if(i==maxWidth)
  66.                                                         clearInterval(BigInter);
  67.                                         }
  68.                                 }
  69.                                 function toBig()
  70.                                 {
  71.                                         clearInterval(SmallInter);
  72.                                         clearInterval(BigInter);
  73.                                                 BigInter = setInterval(Big,InterTime);
  74.                                 }
  75.                                 function Small()
  76.                                 {
  77.                                         if(parseInt(o.style.left)>minWidth)
  78.                                         {
  79.                                                 i = parseInt(o.style.left);
  80.                                                 i -= numInter;
  81.                                                 o.style.left=i+"px";
  82.                                                
  83.                                                 if(i==minWidth)
  84.                                                         clearInterval(SmallInter);
  85.                                         }
  86.                                 }
  87.                                 function toSmall()
  88.                                 {
  89.                                         clearInterval(SmallInter);
  90.                                         clearInterval(BigInter);
  91.                                         SmallInter = setInterval(Small,InterTime);
  92.                                        
  93.                                 }
  94.                                
  95. </SCRIPT>
复制代码

算了,把文件另存一下打包给大家。直接传到 templates/default目录下

[attach]2482[/attach]

注意是GBK 的 不是UTF-8


导航自己改成自己想要的。

作者: iorili    时间: 2011-7-6 10:43:45

感谢楼主分享




欢迎光临 杭州神话信息技术有限公司 (http://www.cenwor.com/) Powered by Discuz! X2