My opinion is that if you want to simulate a click, you're going to
have to create an event that looks like a click and pass that as a
parameter to the signal call.
On Sep 28, 4:05 am, hzlabs [EMAIL PROTECTED] wrote:
Hi Beau,
as i stated in the answer to Jeremy,
i slightly missunderstood the
I tried that:
- it works when i say
signal (parent, onchange, child);
or
signal (myP, onchange, myImg);
to stay in your example.
- it does not work when i say
signal (child, onchange, child);
or
signal (myImg, onchange, myImg);
and
the event is only connected in the
parent DOM element myP!
Hi Beau,
as i stated in the answer to Jeremy,
i slightly missunderstood the behaviour
of signal in that sense that signal
would emulate an event, rather
then just calling the connected function
(more or less..).
But anyway, i will look into the Signal.js 's
source code to really understand
If yes, could i set this behaviour onto a wish list
That's Bob's department; I'm just some shmoe who reads this list ;-)
However, I do have a thought to solve your problem: why not just pass
the fake target as an extra argument of Signal? In other words, if
you want to simulate a click on
On 26-Sep-07, at 10:59 PM, hzlabs wrote:
But what i did expect was, that when i send a signal to the target via
the
signal function - myImg in your example - the event object e
should
contain both e.target() (myImg) and e.src() (myP). The later as
the
DOM element the function is connected
Short answer: I think you want e.src(), not e.target()
Longer answer: The target of an event is the element that triggered
the event. This is NOT the same as the element the event was attached
to.
For instance, let's say you had:
p id=myPimg id=myImg src=whatever.jpg//p
and you hooked up an
Thank You Jeremy!
Yes, i did understand that e.src() is not nessesarily e.target() -
target() could
be a child DOM element of src(). scr() is the DOM element the event is
connected to.
But what i did expect was, that when i send a signal to the target via
the
signal function - myImg in your