茄子在线看片免费人成视频,午夜福利精品a在线观看,国产高清自产拍在线观看,久久综合久久狠狠综合

    <s id="ddbnn"></s>
  • <sub id="ddbnn"><ol id="ddbnn"></ol></sub>

  • <legend id="ddbnn"></legend><s id="ddbnn"></s>

    基于jQuery實現(xiàn)網(wǎng)頁進度顯示插件
    來源:易賢網(wǎng) 閱讀:1952 次 日期:2015-03-11 15:39:17
    溫馨提示:易賢網(wǎng)小編為您整理了“基于jQuery實現(xiàn)網(wǎng)頁進度顯示插件”,方便廣大網(wǎng)友查閱!

    這篇文章主要介紹了基于jQuery實現(xiàn)網(wǎng)頁進度顯示插件的實現(xiàn)方法以及源碼下載,十分的詳細,并自帶2種皮膚,這里推薦給小伙伴們。

    相信大家都見過類似的網(wǎng)站功能,這種形式的進度顯示可以很方便的讓用戶去理解和操作,

    以下是插件的測試截圖 ,提供了兩個皮膚

    名單

    基于jQuery實現(xiàn)網(wǎng)頁進度顯示插件 三聯(lián)

    進度展示插件皮膚1

    進度展示插件皮膚2

    使用js編寫 可以靈活的生成進度條 方便進對一些工作進度進行圖形顯示

    1、簡單的調(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:"第七步"}];

    //當前進行到第幾步

    var currentStep=5;

    //new一個工具類

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

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

    StepTool.drawStep(currentStep,stepListJson);

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

    function mycall(restult){

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

    StepTool.drawStep(result.value,stepListJson);

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

    }

    2、自定義皮膚修改

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

    html代碼

    代碼如下:

    <title>無標題文檔</title>

    <!--<link rel="stylesheet" href="css/step-dc-style1.css" />-->

    <link rel="stylesheet" href="css/step-dc-style1.css" />

    <script type="text/javascript" src="./step-jquery-dc.js"></script>

    <script type="text/javascript" src="js/jquery.min.js"></script>

    </head>

    <body>

    <div class="step_context test">

    </div>

    當前步驟:第<input type="text" value="5" id="currentStepVal" />步 <button onclick="StepTool.drawStep(jQuery('#currentStepVal').val(),stepListJson);" type="button">重新生成</button>

    </body>

    </html>

    <script>

    //所有步驟的數(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:"第七步"}];

    //當前進行到第幾步

    var currentStep=5;

    //new一個工具類

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

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

    StepTool.drawStep(currentStep,stepListJson);

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

    function mycall(restult){

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

    StepTool.drawStep(result.value,stepListJson);

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

    }

    </script>

    javascript代碼

    代碼如下:

    /**

    * @auther DangChengcheng 請保留作者

    * @mailTo

    */

    var Step_Tool_dc =function(ClassName,callFun){

    this.ClassName=ClassName,

    this.callFun=callFun,

    this.Steps = new Array(),

    this.stepAllHtml="";

    }

    Step_Tool_dc.prototype={

    /**

    * 繪制到目標位置

    */

    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+="<ul>";

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

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

    }

    this.stepAllHtml+="</ul>";

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

    this.createEvent();

    } else{

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

    }

    },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="\<span\>"+this.StepNum+"\</span\>";

    stepHtml=stepHtml+"\<a href=\"#\" data-value=\""+this.StepNum+"\" data-text=\""+this.StepText+"\" \>"+this.StepText+"\</a\>";

    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){//當前步驟,下一個未進行,并且不是最后一個

    classSype="coressStep";

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

    classSype="finshlast";

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

    classSype="last";

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

    classSype="loadStep";

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

    classSype="finshStep";

    }

    stepHtml="\<li class=\""+classSype+"\"\>"+stepHtml+"\</a\>";

    this.htmlCode=stepHtml;

    }

    }

    以上就是本文的全部內(nèi)容了,希望大家能夠喜歡。

    更多信息請查看IT技術(shù)專欄

    更多信息請查看腳本欄目
    易賢網(wǎng)手機網(wǎng)站地址:基于jQuery實現(xiàn)網(wǎng)頁進度顯示插件
    由于各方面情況的不斷調(diào)整與變化,易賢網(wǎng)提供的所有考試信息和咨詢回復(fù)僅供參考,敬請考生以權(quán)威部門公布的正式信息和咨詢?yōu)闇剩?/div>

    2026上岸·考公考編培訓(xùn)報班

    • 報班類型
    • 姓名
    • 手機號
    • 驗證碼
    關(guān)于我們 | 聯(lián)系我們 | 人才招聘 | 網(wǎng)站聲明 | 網(wǎng)站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點 | 投訴建議
    工業(yè)和信息化部備案號:滇ICP備2023014141號-1 云南省教育廳備案號:云教ICP備0901021 滇公網(wǎng)安備53010202001879號 人力資源服務(wù)許可證:(云)人服證字(2023)第0102001523號
    聯(lián)系電話:0871-65099533/13759567129 獲取招聘考試信息及咨詢關(guān)注公眾號:hfpxwx
    咨詢QQ:1093837350(9:00—18:00)版權(quán)所有:易賢網(wǎng)