Hi,
I want to call a function onclick and pass the event object to the function:
progressBarOuter.onclick = function(e) {
var x; if (!e) {
x=window.event.clientX;
}
else {
x = e.clientX
}
yt.clickedOffset = x; yt.progressBarClicked
}
So i'm assigning clickedOffset to by enclosing object (yt) and then calling progressBarClicked which then uses the clickedOffset var. But what I actually would rather be doing is something like this:
progressBarOuter.onclick = yt.progressBarClicked(e);
Because it's much more compact. Problem is that even if the user has clicked or not this bit of code is executed... yt.progressBarClicked(e).
Is there any way around this?