range - seiyria/bootstrap-slider getValue() not working -


i've looked through answers on topic, reason can't work. i've set slider following markup:

<input data-slider-id="xslide" type="text" data-provide="slider" data-slider-min="0" data-slider-max="10" data-slider-step=".5" data-slider-value="0" data-slider-tooltip="show" data-slider-orientation="vertical" data-slider-reversed="true"></input> 

what want first of console.log numerical value. i've tried playing type number or text didn't work. tried per example on github:

var myslider = $("xslide").slider(); var value = myslider.slider('getvalue'); console.log(value); 

but produced error $(...).getvalue not function

i tried writing $('#xslide').data('slider').getvalue() produced error $(...).data(...) undefined.

i tried solutions offered on example page like

$('#xslide').slider({     formatter: function(value) {         console.log('current value: ' + value);     } }); 

but doesn't show in console @ all..

i've included following js , css files:

<script src="js/bootstrap-slider.min.js"></script> <link href="stylesheets/bootstrap-slider.min.css" rel="stylesheet"> 

not sure why isn't working... perhaps it's input element id or type, appreciated.

in case far i've solved using:

var xslide = new slider('#xslide');   xslide.on('slidestop', function (value) { document.getelementbyid('xval').innerhtml = value;  }) 

thanks!


Comments

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -