Am I being dim - this works great with 2 sliders but doesnt work when you add a 3rd...?<
// gather amounts
var amount1 = hypeDocument.currentTimeInTimelineNamed('slider 1');
var amount2 = hypeDocument.currentTimeInTimelineNamed('slider 2');
var amount3 = hypeDocument.currentTimeInTimelineNamed('slider 3');
// calculate sum
var sum = (amount1 + amount2 + amount3);
// get elements
var amount1Element = hypeDocument.getElementById('amount1');
var amount2Element = hypeDocument.getElementById('amount2');
var amount3Element = hypeDocument.getElementById('amount3');
var sumElement = hypeDocument.getElementById('sum');
// set elements to new values
amount1Element.innerHTML = amount1.toFixed(0);
amount2Element.innerHTML = amount2.toFixed(0);
amount3Element.innerHTML = amount3.toFixed(0);
sumElement.innerHTML = sum.toFixed(0);
It looks fine to me - is your timeline named exactly “slider 3” and is your element named exactly “amount3” ? Might be easier to post a zip of your .hype document because one cannot test any theories without it.
Just thought I’d share the work in progress for this project - this link is for the MOBILE only version - but it uses Java script ( newbie style ) and Hype.
I do notice the slide handles stick when you go all the way to 10. It then becomes difficult to slide it back. I found I would need to tap twice hold and then drag…