jquery - Progress Bar Increment/Decrement -
i need progress bar semantic ui. i'm trying replicate first example increment/decrement button, life of me, can't work, on matter or sample javascript code appreciated.
the code page located here, , looking @ section in particular:
$buttons .on('click', function() { var $progress = $(this).closest('.example').find('.ui.progress') ; if( $(this).hasclass('increment') ) { $progress.progress('increment'); } else { $progress.progress('decrement'); } }) ;
as can see, each button added click
event. then, $progress
assigned closest found progress bar. finally, check class of button (to know if in/decrement) , .progress
value gets used accordingly.
while @ it, here's html use buttons:
<div class="example"> <div class="ui progress"> <div class="bar"> <div class="progress"></div> </div> </div> <div class="ui icon buttons"> <div class="decrement ui basic red button"><i class="minus icon"></i></div> <div class="increment ui basic green button"><i class="plus icon"></i></div> </div> </div>
Comments
Post a Comment