Klaus Hartl schrieb:
>>>
>>> I already tried that with my new history/hijax plugin. But I had the
>>> need to pass in the 'e' object, which isn't possible in trigger...
>>>
>>> I needed e.clientX to distinguish between a true click and a triggered
>>> click event. Maybe someone has an alternative idea for that?
>>>
>>>
>> Could you explain that in more detail?
>>
>> -- Jörn
>>
>
>
> The code looked like this:
>
> $('a.remote')
> .bind('history', function() {
> ...
> })
> .click(function(e) {
> $(this).trigger('history');
> ...
> });
>
> What I needed is to pass e from the click event to the trigger, or
> generally speaking, to pass the event object of the event that triggered
> the custom event. Not sure if it would be possible to add that
> information to the event object of the custom event.
>
> Or something like the following would be useful:
>
> $(this).trigger('history', [argument, anotherArgument]); // triggers
> history handler function with the arguments passed in...
>
John is always in to leave some undocumented stuff in the code. I took a
look at trigger and noticed a second parameter. Actually, something like
this could be possible:
$('a.remote')
.bind('history', function(event, data) {
// data == click event
})
.click(function(e) {
$(this).trigger('history', e);
...
});
I'll investigate this further and try to put something together to test
or demonstrate the possibilites.
--
Jörn Zaefferer
http://bassistance.de
_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/