Hi,
First I still use protototype 1.5.1.
I'm creating something like that using prototype and script.aculo.us
---------------------------------------------------------------------------------------
<div id="divLangue" class="listeACocher">
<input type="hidden" id="Langue" name="Langue" />
<input type="text" id="txtLangue" name="txtLangue" />
<ul>
<li class="impaire"><input type="checkbox" id="chkLangue1"
name="chkLangue" value="1" /> français</li>
<li class="paire"><input type="checkbox" id="chkLangue2"
name="chkLangue" value="2" /> anglais</li>
<li class="impaire"><input type="checkbox" id="chkLangue3"
name="chkLangue" value="3" /> allemand</li>
<li class="paire"><input type="checkbox" id="chkLangue4"
name="chkLangue" value="4" /> espagnol</li>
<li class="impaire"><input type="checkbox" id="chkLangue5"
name="chkLangue" value="5" /> italien</li>
</ul>
</div>
---------------------------------------------------------------------------------------
The problem is : I would like to handle the $('divLangue') mouseout
event. I have obviously some problems with event bubbling. If I leave
one <li> to another one, it fires the $('divLangue') mouseout event. I
tried to use Event.stop(e) but I didn't see any changes. I didn't
succeed, as well, to find if elements have the same ancestor to don't
fire the event.
I found a very interesting post, it inspired me, but I failed and I'm
writing here now!
http://groups.google.fr/group/rubyonrails-spinoffs/browse_frm/thread/18e678f63fd39658/d0a3ab56d805f706?hl=fr&lnk=gst&q=event.observe+bubble#d0a3ab56d805f706
Here is a small and obvious code with Event.stop(e), right now I can't
do better...
---------------------------------------------------------------------------------------
Event.observe($("divLangue"), "mouseout", function (e) {
var $elm = Event.element(e);
Event.stop(e);
alert($elm.ancestors());
});
---------------------------------------------------------------------------------------
Do you see what's I'm doing wrong?
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---