I am encountering issues with my slider as it is not changing the value properly. Every time I try, I receive an error message in the console saying "
Uncaught TypeError: Cannot set property 'opacity' of undefined
".
What I want to achieve is to adjust the opacity value from 1 (the initial value) to a value calculated as the slider value multiplied by .01...
This is my script:
<div id="jpegcam" class="jpegcam_slider" style="opacity: 1; z-index: 1; position: absolute; margin-left: auto; margin-right: auto; left: 0; right: 0; top: 239px"></div>
<input id="ex1" data-slider-id='ex1Slider' type="text" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="100"/>
<script>
$('#ex1').slider({
formater: function(opacity) {
return 'Current value: ' + opacity;
}
});
$('#ex1').on('slide', function(value)
{
$('.jpegcam_slider').style.opacity = (value*.01);
});
</script>
I have been researching for quite some time on Google and forums but haven't found a solution yet...
Can anyone point out what I might be doing incorrectly? Thank you!
PS: I am utilizing the slider bootstrap js and css plugin available here.