亚洲一级电影在线观看,九九精品无码专区免费,亚洲AV无码资源在线观看 ,欧美国产高清

jQuery實(shí)現(xiàn)網(wǎng)頁(yè)進(jìn)度顯示插件方法

時(shí)間:2024-09-24 02:11:15 jQuery Mobile 我要投稿
  • 相關(guān)推薦

jQuery實(shí)現(xiàn)網(wǎng)頁(yè)進(jìn)度顯示插件方法

  使用js編寫(xiě) 可以靈活的生成進(jìn)度條 方便進(jìn)對(duì)一些工作進(jìn)度進(jìn)行圖形顯示

  1、簡(jiǎn)單的調(diào)用

  //所有步驟的數(shù)據(jù)

  var stepListJson=[{StepNum:1,StepText:“第一步”},

  {StepNum:2,StepText:"第二步"},

  {StepNum:3,StepText:"第三步"},

  {StepNum:4,StepText:"第四步"},

  {StepNum:5,StepText:"第五步"},

  {StepNum:6,StepText:"第六步"},

  {StepNum:7,StepText:"第七步"}];

  //當(dāng)前進(jìn)行到第幾步

  var currentStep=5;

  //new一個(gè)工具類(lèi)

  var StepTool = new Step_Tool_dc(“test”,“mycall”);

  //使用工具對(duì)頁(yè)面繪制相關(guān)流程步驟圖形顯示

  StepTool.drawStep(currentStep,stepListJson);

  //回調(diào)函數(shù)

  function mycall(restult){

  // alert(“mycall”+result.value+“:“+result.text);

  StepTool.drawStep(result.value,stepListJson);

  //TODO…這里可以填充點(diǎn)擊步驟的后加載相對(duì)應(yīng)數(shù)據(jù)的代碼

  }

  2、自定義皮膚修改

  插件提供了兩套皮膚科共選擇如果不能滿足您的要求,則自己編寫(xiě)CSS代碼即可

  html代碼

  復(fù)制代碼 代碼如下:

  當(dāng)前步驟:第步重新生成

  //所有步驟的數(shù)據(jù)

  var stepListJson=[{StepNum:1,StepText:"第一步"},

  {StepNum:2,StepText:"第二步"},

  {StepNum:3,StepText:"第三步"},

  {StepNum:4,StepText:"第四步"},

  {StepNum:5,StepText:"第五步"},

  {StepNum:6,StepText:"第六步"},

  {StepNum:7,StepText:"第七步"}];

  //當(dāng)前進(jìn)行到第幾步

  var currentStep=5;

  //new一個(gè)工具類(lèi)

  var StepTool = new Step_Tool_dc("test","mycall");

  //使用工具對(duì)頁(yè)面繪制相關(guān)流程步驟圖形顯示

  StepTool.drawStep(currentStep,stepListJson);

  //回調(diào)函數(shù)

  function mycall(restult){

  // alert("mycall"+result.value+":"+result.text);

  StepTool.drawStep(result.value,stepListJson);

  //TODO...這里可以填充點(diǎn)擊步驟的后加載相對(duì)應(yīng)數(shù)據(jù)的代碼

  }

  javascript代碼

  復(fù)制代碼 代碼如下:

  /**

  * @auther DangChengcheng 請(qǐng)保留作者

  * @mailTo dc2002007@163.com

  */

  var Step_Tool_dc =function(ClassName,callFun){

  this.ClassName=ClassName,

  this.callFun=callFun,

  this.Steps = new Array(),

  this.stepAllHtml="";

  }

  Step_Tool_dc.prototype={

  /**

  * 繪制到目標(biāo)位置

  */

  createStepArray:function(currStep,stepListJson){

  this.currStep=currStep;

  for (var i=0; i<stepListJson.length;i++){

  var Step_Obj =new Step( this.currStep,stepListJson[i].StepNum,stepListJson[i].StepText,stepListJson.length);

  Step_Obj.createStepHtml();

  this.Steps.push(Step_Obj);

  }

  },

  drawStep:function(currStep,stepListJson){

  this.clear();

  this.createStepArray(currStep,stepListJson);

  if(this.Steps.length>0){

  this.stepAllHtml+="

  ";

  for (var i=0; i<this.Steps.length;i++){

  this.stepAllHtml+=this.Steps[i].htmlCode;

  }

  this.stepAllHtml+="";

  jQuery("."+this.ClassName).html(this.stepAllHtml);

  this.createEvent();

  } else{

  jQuery("."+this.ClassName).html("沒(méi)有任何步驟");

  }

  },createEvent:function(){

  var self=this;

  jQuery("."+this.ClassName+" ul li a").click(function(){

  var num=jQuery(this).attr("data-value");

  var text=jQuery(this).attr("data-text");

  result={value:num,text:text} ;

  eval(self.callFun+"(result)");

  });

  }

  ,clear:function(){

  this.Steps=new Array();

  jQuery("."+this.ClassName).html("");

  this.stepAllHtml="";

  }

  }

  var Step=function(currStep,StepNum,StepText,totalCount){

  this.currStep=currStep,

  this.StepNum=StepNum ,

  this.StepText=StepText,

  this.totalCount=totalCount,

  this.htmlCode="";

  }

  Step.prototype={

  createStepHtml:function(){

  var stepHtml=""+this.StepNum+"";

  stepHtml=stepHtml+""+this.StepText+"";

  if(this.currStep>this.totalCount){

  this.currStep=this.totalCount;

  }else if(this.currStep<=0){this.currStep=1;}

  if(this.currStep>this.StepNum&&this.StepNum==1){

  classSype="firstFinshStep";

  } else if(this.currStep==this.StepNum&&this.StepNum==1){

  classSype="firstFinshStep_curr1";

  }

  else if(this.currStep==this.StepNum&&this.currStep!=this.totalCount){//當(dāng)前步驟,下一個(gè)未進(jìn)行,并且不是最后一個(gè)

  classSype="coressStep";

  }else if(this.currStep==this.StepNum&&this.StepNum==this.totalCount){//當(dāng)前步驟 并且是最后一步

  classSype="finshlast";

  }else if(this.currStep<this.StepNum&&this.StepNum==this.totalCount){//未進(jìn)行步驟,并且是最后一個(gè)

  classSype="last";

  } else if(this.currStep<this.StepNum){//未進(jìn)行的步驟

  classSype="loadStep";

  } else if(this.currStep>this.StepNum){//已進(jìn)行的步驟

  classSype="finshStep";

  }

  stepHtml="

  "+stepHtml+"";

  this.htmlCode=stepHtml;

  }

  }


【 jQuery實(shí)現(xiàn)網(wǎng)頁(yè)進(jìn)度顯示插件方法】相關(guān)文章:

關(guān)于jQuery實(shí)現(xiàn)高亮顯示的方法介紹08-20

關(guān)于jquery簡(jiǎn)單圖片切換顯示效果實(shí)現(xiàn)方法介紹10-01

總監(jiān)實(shí)現(xiàn)對(duì)施工進(jìn)度控制方法08-15

jQuery(js)如何獲取文字寬度(顯示長(zhǎng)度)09-29

jQuery中prev()方法用法07-16

jQuery中replaceAll()方法用法10-15

用SQL實(shí)現(xiàn)查詢數(shù)據(jù)不顯示錯(cuò)誤數(shù)據(jù)的方法08-19

excel分級(jí)顯示的方法10-21

jquery之超簡(jiǎn)單的div顯示和隱藏特效demo簡(jiǎn)介05-15

關(guān)jQuery彈出窗口簡(jiǎn)單實(shí)現(xiàn)代碼-javascript編程06-07

主站蜘蛛池模板: 中国杭州少妇xxxx做受| 南澳县| 日本50岁丰满熟妇xxxx| 另类色综合| 国内老司机精品视频在线播出| 亚洲综合无码精品一区二区三区| 久久国产色av免费看| 国产精品原创av片国产日韩| 久久伊人五月丁香狠狠色| 色综合久久精品中文字幕| 亚洲精品午夜一区人人爽| 国产欧美日韩亚洲一二三区| 罗平县| 国产精品爱久久久久久久小说| 漂亮少妇高潮在线观看| 襄汾县| 亚洲国产精彩中文乱码av| 五月丁香六月激情综合在线视频| 又大又长粗又爽又黄少妇毛片| 大地资源中文在线观看官网第二页| 久久中文字幕人妻熟av女| 中文字幕亚洲一区二区va在线| 久久免费视频播放| 脱岳裙子从后面挺进去视频| 国产三级在线观看播放| 丁香五月激情图片| 国产极品美女高潮抽搐免费网站| 精品超清无码视频在线观看| 九九热免费在线视频| 好爽好黄的视频| 欧美疯狂性受xxxxx另类| 国产成人a毛片在线| 日韩欧美中文字幕在线三区| 精品人妻系列无码人妻漫画| 国产精品美女久久久网站| 香蕉人妻av久久久久天天| 一级无码国产精品毛片| 国产又色又爽无遮挡免费软件 | 国产精品色吧国产精品| 久久人妻系列无码一区| 国产精品亚洲综合一区在线观看|