Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

279
Vistas
Jquery steps customization

So now I'm trying to customize Jquery steps by adding a score for each question's option. But the problem is that I can't find where check if the next button is check or not and the same thing for previous button. Simply I want to push the score of the answer in array when next button is click and remove it from array when previous is clicked. But I can't call next and previous function.

This is Jquery steps:

$(function() {
      $("#wizard").steps({

            headerTag: "h4",
            bodyTag: "section",
            transitionEffect: "fade",
            enableAllSteps: true,
            transitionEffectSpeed: 500,
            onStepChanging: function(event, currentIndex, newIndex) {
                qIndex = newIndex;
                if (newIndex === 1) {
                  $('.steps ul').addClass('step-2');
                } else {
                  $('.steps ul').removeClass('step-2');
                }

and that 's what I', trying to do:

$('.forward').click(function() {
    $("#wizard").steps('next');
    total.push(currentScore);
})

$('.backward').click(function() {
    total.pop(currentScore);
    $("#wizard").steps('previous');
})
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

So, there is something called Events in Jquery-Steps. You can use the events to do what exactly you are trying. Just a quick hint what you can do is use onStepChanging event which accepts 3 parameters event, currentIndex, newIndex You may compare currentIndex and newIndex to push and remove the score of the answer in array:

if(newIndex > currentIndex) {// push }
if(newIndex < currentIndex) {// pop }

Refer the doc here

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda