Categorías
Otros

barra de progreso del paso de implementación de jqurey

Necesidad de importar plugin

  1. jquery.min.js
  2. jquery.step.min.js
  3. jquery.step.css

    Código

<!DOCTYPE html>
<html>

<head>
<meta charset="utf-8" />
<title>jQuery step by step</title>

<link rel="stylesheet" type="text/css" href="css/jquery.step.css" />

<script src="js/jquery.min.js"></script>
<script src="js/jquery.step.min.js"></script>

<style>
button {
    display: inline-block;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.42857143;
    text-align: center;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    color: #fff;
    background-color: #5bc0de;
}

.main {
    width: 1000px;
    margin: 100px auto;
}

#step {
    margin-bottom: 60px;
}

.btns {
    float: left;
}

.info {
    float: left;
    height: 34px;
    line-height: 34px;
    margin-left: 40px;
    font-size: 28px;
    font-weight: bold;
    color: #928787;
}

.info span {
    color: red;
}
</style>
</head>

<body>

<div class="main">
    <div id="step"></div>
    <div class="btns">
        <button id="prevBtn">Previous</button>
        <button id="nextBtn">Next step</button>
        <button id="btn1">Skip to the second step</button>
        <button id="btn2">Skip to step three</button>
    </div>
    <div class="info">index:<span id="index"></span></div>
</div>

<script type="text/javascript">
    var $step = $("#step");
    var $index = $("#index");

    $step.step({
        index: 0,
        time: 500,
        title: ["sign the application form", "Upload data", "to be confirmed", "confirmed", "Appointment completed"]
    });

    $index.text($step.getIndex());

    $("#prevBtn").on("click", function() {
        $step.prevStep();
        $index.text($step.getIndex());
    });

    $("#nextBtn").on("click", function() {
        $step.nextStep();
        $index.text($step.getIndex());
    });

    $("#btn1").on("click", function() {
        $step.toStep(1);
        $index.text($step.getIndex());
    });

    $("#btn2").on("click", function() {
        $step.toStep(2);
        $index.text($step.getIndex());
    });
</script>

</body>
</html>

.

  Escenarios de uso de puntos de conocimiento de referencias blandas o referencias débiles en el desarrollo real

Por Programación.Click

Más de 20 años programando en diferentes lenguajes de programación. Apasionado del code clean y el terminar lo que se empieza. ¿Programamos de verdad?

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *