MC百科版本切换系统备份 by.Ahrwing_RebirthIsHope at 2014-2-27

来源:互联网 发布:硬笔书法网络直播课 编辑:程序博客网 时间:2024/05/22 07:05


 

/** * MC百科版本切换系统 * @RebirthisHope  * @copyright 2014 */ $(document).ready(function(){  /* var AllList = $(".main_outside"); var AnimateList= $(".Vers"); */ LRList = $(".Vers #ToLeftVers,.vers #ToRightVers"); LeftList = $(".Vers #ToLeftVers"); RightList = $(".Vers #ToRightVers");  MaxNum = $(MainStr).length - 1;  VerNum = MaxNum; //自动跳转到当前所在的版本  VerJumpTo = nMoveNum * MaxNum;

 VerJumpTo = '-=' + VerJumpTo + 'px'; $(MoveStr).animate({"margin-left":VerJumpTo});

 VersCK();  /* //切换按钮显示 AllList.mouseenter(function(){      AnimateList.animate({opacity:1.0});   });  //切换按钮隐藏 AllList.mouseleave(function(){      AnimateList.animate({opacity:0.0});     }); */  //更新版本点击事件 for(var i = 0; i < LeftList.length; i++){  LeftList[i].i = i;  LeftList[i].onclick = function(){       $(MoveStr).animate({"margin-left":"+=" + nMoveNum + "px"});   VerNum -= 1;      VersCK();         //动态获取参数   var NewVal= $("#List_" + (VerNum + 1) + " #NewIdForId").val();      if(NewVal){        NewStrClean(NewVal);       }        }; }  //更老版本点击事件 for(var i = 0; i < RightList.length; i++){  RightList[i].i = i;  RightList[i].onclick = function(){     $(MoveStr).animate({"margin-left":"-=" + nMoveNum + "px"});   VerNum += 1;      VersCK();      //动态获取参数   var NewVal= $("#List_" + (VerNum + 1) + " #NewIdForId").val();      if(NewVal){        NewStrClean(NewVal);       }

  }; }  //版本按钮显示检测 function VersCK(){    $("#ToLeftVers").attr('title','查看' + strName + '以前的版本\n' + '共 ' + (MaxNum+1) + ' 个,' + '当前第 ' + (VerNum+1) + ' 个。');  $("#ToRightVers").attr('title','查看' + strName + '更新的版本\n' + '共 ' + (MaxNum+1) + ' 个,' + '当前第 ' + (VerNum+1) + ' 个。');      if(VerNum <= 0){      LeftList.css({display:"none"});     }else{      LeftList.css({display:"block"});

  }    if(VerNum >= MaxNum){      RightList.css({display:"none"});     }else{      RightList.css({display:"block"});

  }

  $(".right_outside").animate({"height": $("#List_" + (VerNum + 1)).height()},250);   }  });


 

0 0