Sorry, I needed some more test, i did not use traditionnal event
model:
try this:


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>

<html xmlns="http://www.w3.org/1999/xhtml"; lang="en" xml:lang="en">

<head>

    <title>o0O TEST O0o</title>

</head>

<body>
<div id="contener" style="width:100px;height:100px;background-
color:blue" onClick="alert('parent');">

  <div id="child" style="width:50px;height:50px;background-
color:red"></div>

</div>

<script>
var stop='ok';
function process(e){
if (stop=='ok') e.stopPropagation();
alert('event on child launch but stop propagation for parent');
}
document.getElementById('child').onclick=process;
</script>


</script>

</body>

</html>


--
david

On 16 fév, 23:46, david <david.brill...@gmail.com> wrote:
> Hi Jason,
>
> I don't think it's possible, because you use Event inline, and you
> can't control the event bubbling or propagation.
> If you register the event with or without prototype but
> programmatically with the traditionnal model, you could use the
> event.stopPropagation function or for IE the
> window.event.cancelBubble.
>
> Go to this link, everything is explain:
> first part:  http://www.quirksmode.org/js/introevents.html
> second part:  http://www.quirksmode.org/js/events_order.html
>
> and if you want to switch to a registration with prototype, go 
> to:http://prototypejs.org/api/event
>
> --
> david
>
> On 16 fév, 22:50, Jason Frisvold <xenopha...@gmail.com> wrote:
>
> > I'm not sure if this calls for a redesign, or if this is valid behavior.
> >  I have a table with an onClick action on the <tr> tags.  Normally, I
> > want this behavior to fire every time a row is clicked with one
> > exception.  Within the <tr> is an <a href> that triggers a different
> > behavior on a click.  At the moment, both behaviors fire simultaneously,
> > both completing as they should.  What I'd like to do is prevent the <tr>
> > onclick from firing when I've specifically clicked on the <a href>.  Is
> > this possible?
>
> > The code looks like this (using PHP smarty) :
>
> > <tr onclick='showPopup(this, {$row.id});' >
> >    <td>{$row.vendor}</td>
> >    <td>
> >       <div id='trust-{$row.id}'>
> >          <img src='images/icon_thumbsup.gif' style='border: none'
> > onclick='setTrust(1, {$row.id}, {$row.trust});' />
> >          {$row.trust}
> >          <img src='images/icon_thumbsdown.gif' style='border: none'
> > onclick='setTrust(0, {$row.id}, {$row.trust});' />
> >       </div>
> >    </td>
> > </tr>
>
> > Both onclick functions are essentially ajax.updater functions with some
> > scriptaculous effects thrown in for good measure.
>
> > Thanks,
>
> > --
> > ---------------------------
> > Jason Frisvold
> > xenopha...@gmail.com
> > ---------------------------
> > "I love deadlines. I like the whooshing sound they make as they fly by."
> >    - Douglas Adams
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to