I want to know whether it is possible to add properties to an event object that is passed to the bind () event handler function. I have a piece of code that is associated with "mousedown". I would like to trigger this event explicitly. The problem is that the bind () handler expects some event properties that are provided when the mouse fires the event; namely "pageX" and "pageY".
I know that I can pass additional parameters as an array to Trigger (), but I would prefer not to change the bind () code. This may not be possible.
I would like to call the handler below and fake pageX. Can this be done somehow?
currentObj.bind("mousedown", function(e) { var handleElement = currentObj.find(".HwSliderHandle"); var offsetMultiplier = calculateOffsetMultiplier(); var newPosition = Math.round(e.pageX/offsetMultiplier) - sliderInfo.contextOffset.left; moveHandleTo(handleElement, newPosition); });
source share