jquery - Applying run and stop button -


how achieve following:

  1. when click run button, should hide , show stop button.

  2. upon clicking run button, execute coded statements, still being able click previous , next button while stop button still being shown

  3. when click stop button, should hide , show run button.

  4. it should exit or stop statement intended run run button

this thought of @ first, how can right (algo|pseudocode|simple presentation code)

  $('#run').click(function e(){   //hide #run   //show #stop    //execute statements x   //prev , next button must still clickable here    $('#stop').click(function e(){   //hide #stop   //show #run   //go outside run stop execute statements x   });    }); 

this handle button behaviours you've described. business of stopping statement depend on they're doing , how. more information required answer that.

$('#run').on('click', function(){   $('#run').hide();   $('#stop, #previous, #next').show();   executestatements(); });  $('#stop').on('click', function(){   $('#run').show();   $('#stop, #previous, #next').hide();   //    // stopexecutingstatements();   // }); 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -