Here is a JSFIDDLE about my problem.
I want to drag the slider (with speech bubble above it) left and right. As it slides between the blue and green colours on the bar behind it, it will set the opacity of image 1 to 90% and the opacity of image 2 to 10%, image1 80% image 2 20%, image 1 70% - image2 30% etc till the slider reaches end of green and the opacity of image 1 is set to 0% and image 2 to 100%, then as the slider keeps sliding to the right, from green to red, image 2 reaches 0% and image 3 is 100%. Repeat with the next image.
I’ve looked at http://jqueryui.com/demos/slider/ which seems to do what I want, but I’m not sure how to get the X position of the slider, then apply that to the opacity of image1, image2, image3, image4.
The slider is 960px wide, so 960 / 4 = 240, for each 240 pixels along the slider the opacity needs to be set from 0-100%.
Firstly, is this possible in jquery? Secondly, can anyone help with the code or show me some links which may help?
1 Answer