No, I am no gentleman.:-) I am just a retired bloke from Watford, Herts who
moved to nr. Cheadle, Staffs in July last year to be closer to my daughter
and her family and especially the grandkids. So I am spending a bit of time
getting to know linux properly and developing some web apps with asp mostly
at the moment but I am gradually getting the hang of cgi perl.
Walter
-----Original Message-----
From: staffslug-bounces(a)staffslug.org.uk
[mailto:staffslug-bounces@staffslug.org.uk] On Behalf Of Adam Egan
Sent: 18 February 2010 19:22
To: staffslug(a)staffslug.org.uk
Subject: Re: [Staffslug] Javascript Problem
Just to check...
Are you the gentleman from Canada who came to the October (I think) meeting?
Adam
On 18 February 2010 19:19, walt <walt(a)helvatron.co.uk> wrote:
Thanks. And you are right. I had already used alert to check the
IDs 2
or
3 days ago and it does work its way back from say c1 back up to a1
without
any help from me. None of the languages I have used do this or at least I
have never seen it happen.
Anyway, I'll check out event propagation later on. Meantime thanks for
your
offer to look into a fix. No rush! I just wanted to understand dom
and
then
thought I could use all these javascript tricks to generate a nifty
menu
system. :-)
Regards, Walter
-----Original Message-----
From: staffslug-bounces(a)staffslug.org.uk
[mailto:staffslug-bounces@staffslug.org.uk] On Behalf Of David Boucher
Sent: 18 February 2010 18:51
To: staffslug(a)staffslug.org.uk
Subject: Re: [Staffslug] Javascript Problem
walt wrote:
> [snipped]
> I thought it might be the 'onclick' calls in the sibling elements but
when
I
> take them out it still happens.
> [snipped]
What's happening here is event propagation: the event "bubbles up"
through the elements, so findChildren is called for b1, then called for
a1, causing the effect you are seeing. You can prove this by having
findChildren produce an alert with the id of the element it is being
called for.
I don't have time to do it right now, but I'll see if I can sort out a
fix later (I'm no Javascript expert though). In the meantime, you might
want to try looking into "Javascript event propagation".
Hope this helps,
Dave.
_______________________________________________
Staffslug mailing list
Staffslug(a)staffslug.org.uk
http://lists.staffslug.org.uk/mailman/listinfo/staffslug
_______________________________________________
Staffslug mailing list
Staffslug(a)staffslug.org.uk
http://lists.staffslug.org.uk/mailman/listinfo/staffslug
_______________________________________________
Staffslug mailing list
Staffslug(a)staffslug.org.uk
http://lists.staffslug.org.uk/mailman/listinfo/staffslug