While returning false will stop the event from propagating, it will also
prevent the default action from occurring, which isn't necessarily
desirable. In this case it might not matter, but in general,
event.stopPropagation() is the "right" way to stop the event from
propagating. Returning false does both event.stopPropagation() and
event.preventDefault().

--Erik


On 12/21/07, Shawn <[EMAIL PROTECTED]> wrote:
>
>
> You probably need to return false from your click handlers
>
>          // highlight rows, load details
>         $("#myTable tr").mouseover(function() {
>                 $(this).addClass("over");}).mouseout(function() {
>                 $(this).removeClass("over");
>         }).click(function(){
> $(this).addClass("thisRow").siblings().removeClass("thisRow");
>                 var job = $(this).attr('id')
>                 var details = (job + '.htm')
>                 $("#console").load(details);
>                 return false;
>         });
>
>         $("#myTable a.ackn").click( function(){
>                 $(this).parents('tr').hide();
>                  return false;
>         });
>
> That *should* take care of things for you...
>
> Shawn
>
> rolfsf wrote:
> >
> > I've set up a simple action when a user clicks on a row in a table.
> > (highlight the row, load some details via ajax into a div)
> >
> > However, in one column of the table I've got a link/button that, when
> > clicked, will hide that row. If clicked, I don't want to highlight the
> row
> > or load it's details. How do I distinguish between the two?
> >
> >
> >       // highlight rows, load details
> >       $("#myTable tr").mouseover(function() {
> >               $(this).addClass("over");}).mouseout(function() {
> >               $(this).removeClass("over");
> >       }).click(function(){
> >
> $(this).addClass("thisRow").siblings().removeClass("thisRow");
> >               var job = $(this).attr('id')
> >               var details = (job + '.htm')
> >               $("#console").load(details);
> >       });
> >
> >
> >       // hide a row after acknowledgement
> >       $("#myTable a.ackn").click( function(){
> >               $(this).parents('tr').hide();
> >       });
> >
> > thanks,
> > r.
>

Reply via email to