I am trying to use jQuery to change some HTML text by changing a slider, I figured out how to do that, but I also need to do it only if a checkbox is on, how do I put both in, and then how do I make it only do it when the checkbox is clicked, I am doing this with arrays, because I'm trying to do it in time, not decimals. Here is the link to my current code: http://ift.tt/2fiRLxc
$(document).on('input change', '#range-slider', '#voiceover', function() { //Listen to slider changes (input changes)
var v=$(this).val(); //Create a Variable (v), and store the value of the input change (Ex. Image 2 [imageURL])
var q = document.querySelector('input[id="voiceover"]');
var voiceovermain = ["<span>$0.00</span>",
voiceoverslider[0]
];
$('#sliderStatus').html(imageUrl[v]);
$('#sliderPrice').html( sizeRange[v] );
$('#voiceoverslider').html( sizeRange[v] );
$('#voiceoverspan').html( voiceover[q] );
$("#img").prop("src", imageUrl[v]); // Modify the Images attribute src based on the sliders value, and input the value inside the imageURL[v] to display image
});
This is one of my first times using the code thing on this website, so pardon my messed up whitespaces.
I English very well :) so I'm sorry if something doesn't make sense. Just tell me in the comments if it doesn't.
Aucun commentaire:
Enregistrer un commentaire