Jarod, I believe this gives me a good direction. It embodies all the nice
features of jQ. Thank you!

I understand there has to be a flag of some sore set and this is nice
because it passes the path only if the switch is checked. Is the "rel" in
the last statement suppose to be "ref"?

I'll try to get it to work on the accordian menu from Rick Resig today.

Mitch

-----Original Message-----
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Jarod
Sent: Monday, August 06, 2007 9:16 PM
To: jQuery (English)
Subject: [jQuery] Re: how to disable a handler with a click


Hi Mitchell,

<a class="sound_event" ref="../sounds/sound1.mp3">link1</a>
<a class="sound_event" ref="../sounds/sound2.mp3">link2</a>
<input type="checkbox" id="sound_switch" value="turn on/off"/>

$(document).ready(function(){
  $(".sound_event").click(function(){
    if ($("#sound_switch").attr("checked")) {
        execEventSound($(this).attr("rel"));
    }
  })
});


i hope this will help, ( the code i have not try yet^_^)

On Aug 7, 11:23 am, "Mitchell Waite" <[EMAIL PROTECTED]> wrote:
> I have a check box that I want to disable the sound in my app when its
> checked and restore sounds when its unchecked.
>
> The sounds in my app are created when the user clicks on a link that has a
> handler like this:
>
> onclick="execEventSound('../sounds/sound1.mp3')"
>
> I was thinking the easy way to disable that would be to insert or append
> something  to it. So my question is
>
> a)      Can you insert or append HTML or text to a "onclick", e.g. how
would
> I select it as a target?
>
> b)      What would be the best way to disable this onclick?
>
> Thanks
>
> Mitch



Reply via email to