[jQuery] Bind triggers function
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=406560101-31012007><FONT face=Tahoma>Hello,</FONT></SPAN></DIV>
<DIV><SPAN class=406560101-31012007><FONT face=Tahoma></FONT></SPAN> </DIV>
<DIV><SPAN class=406560101-31012007><FONT face=Tahoma>I am writing a jquery
script. It works fine in firefox, but in IE when I bind a function to
click it causes that function to trigger. Here is part of the code.
The faqLoad function fires on page load. If I remember correctly this
happened with I used click instead of bind.</FONT></SPAN></DIV>
<DIV><SPAN class=406560101-31012007><FONT face=Tahoma></FONT></SPAN> </DIV>
<DIV><SPAN class=406560101-31012007><FONT face=Tahoma>Any help would be
appreciated.</FONT></SPAN></DIV>
<DIV><SPAN class=406560101-31012007><FONT face=Tahoma></FONT></SPAN> </DIV>
<DIV><SPAN class=406560101-31012007><FONT face=Tahoma>John</FONT></SPAN></DIV>
<DIV><SPAN class=406560101-31012007></SPAN> </DIV>
<DIV><SPAN class=406560101-31012007><FONT face=Tahoma></FONT></SPAN> </DIV>
<DIV><SPAN class=406560101-31012007><FONT face=Tahoma>function
faqExpand(){<BR>$(this).find("img").attr("src","<A
href="http://www.ptclinic.com/faq/minus.gif">http://www.ptclinic.com/faq/minus.gif</A>");<BR>$(this).next().slideDown("normal").animateColor(1500,
{backgroundColor:['#ff0','#fff']});<BR>$(this).unbind("click");<BR>$(this).bind("click",faqCollapse);<BR>$(this).attr("title","Collapse
Answer");<BR>return false;<BR>};</FONT></SPAN></DIV>
<DIV> </DIV>
<DIV><SPAN class=406560101-31012007><FONT face=Tahoma>function
faqCollapse(){<BR>$(this).find("img").attr("src","<A
href="http://www.ptclinic.com/faq/plus.gif">http://www.ptclinic.com/faq/plus.gif</A>");<BR>$(this).next().slideUp("normal");<BR>$(this).unbind("click").bind("click",faqExpand);<BR>$(this).attr("title","Expand
Answer");<BR>return false;<BR>};</FONT></SPAN></DIV>
<DIV><SPAN class=406560101-31012007><FONT face=Tahoma><BR>function
faqLoad(){<BR>$(".faqanswer").hide();<BR>$(".question").bind("click",faqExpand);<BR>$(".question").hover(function(){$(this).addClass("over");},function(){$(this).removeClass("over");});<BR>$("#faqTitle").after("<h5
style='text-align:center;'>(Click on a Question to view the
Answer)</h5>");<BR>};</FONT></SPAN></DIV></BODY></HTML>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/