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 Swedberg
www.englishrules.com
www.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