hi Karl,

thanks for pointing the unbind function to me, plus the additional
tips and guide you've given really useful for a beginner like me,
greatly appreciated!

by the way is there a way to check if an object has bind to a certain
events?


cheers,
james

On Sep 22, 10:24 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> Hi James,
>
> First, it's much better to use the CSS ID selector rather than the
> XPath attribute selector here:
>
> $('#customer').click ....
>
> Second, you might want to try using the .unbind() method during the
> user interaction. Something like this, perhaps:
>
>          $('#customer').unbind('click').click(function(){
>                 alert('Lookup customer cant be shown any more.'');
>         });
>
> You can also be a bit more precise in what you're unbinding:
>
> var lookupShow = function() {
>    $('#lookup_customer').show();
>
> };
>
> Then you can do:
>         $('#customer').click(lookupShow);
>
> And later:
>
>         $('#customer').unbind('click', lookupShow).click(function(){
>                 alert('Lookup customer cant be shown any more.'');
>         });
>
> This stuff should be inside a $(document).ready() of course.
>
> Hope that helps.
>
> --Karl
> _________________
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Sep 22, 2007, at 7:35 AM, james_027 wrote:
>
>
>
> > hi
>
> > i have something like this
>
> >         $('[EMAIL PROTECTED]').click(function(){
> >            $('[EMAIL PROTECTED]').show();
> >    });
>
> > and during the user interaction i have something like this
>
> >         $('[EMAIL PROTECTED]').click(function(){
> >            alert('Lookup customer cant be shown any more.'');
> >    });
>
> > I was expecting a new behavior when clicking the <div id="customer">
> > tag, but what happen the two behavior are executing instead of the
> > newer one overiding the older one. How can I achieve this?
>
> > Thanks
> > james

Reply via email to