in Education by
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'); }) JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
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

Related questions

0 votes
    Please refer to my test case https://jsfiddle.net/1c3Lmace/13/ This is my code $(document).ready( ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I have the following Javascript code which controls an accordion type set of divs. The set of divs is ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    I used the example from here http://jqueryui.com/demos/dialog/#animated to create a dialog box. The ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    In the following code, I am attempting to act upon the li element being hovered over. HTML: foo ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 26, 2022 in Education by JackTerrance
0 votes
    As it currently stands, this question is not a good fit for our Q&A format. We expect answers to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    As it currently stands, this question is not a good fit for our Q&A format. We expect answers to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    As it currently stands, this question is not a good fit for our Q&A format. We expect answers to ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 23, 2022 in Education by JackTerrance
0 votes
    $(document).ready(function(){ alert("funciton"); $(function(){ $.fn.gotof(){ alert("I am ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 21, 2022 in Education by JackTerrance
0 votes
    $(document).ready(function(){ alert("funciton"); $(function(){ $.fn.gotof(){ alert("I am ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    $(document).ready(function(){ alert("funciton"); $(function(){ $.fn.gotof(){ alert("I am ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    I've a datepicker, using jQuery. But I want to substract 5 days from the date that is selected ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    I've a datepicker, using jQuery. But I want to substract 5 days from the date that is selected ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 15, 2022 in Education by JackTerrance
0 votes
    How can I sort an event by id in DESC order? My all events are coming and by default they are ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 26, 2022 in Education by JackTerrance
0 votes
    How can I sort an event by id in DESC order? My all events are coming and by default they are ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 20, 2022 in Education by JackTerrance
0 votes
    I have a field as Image. I want to set it compulsory on button click event in javascript. Hereis ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 14, 2022 in Education by JackTerrance
...