<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style>
</head>
<body class='hmmessage'><div dir='ltr'>Pop both anchors in there and do a show/hide. I think there's a toggle for hidden in there somewhere too.<br><br>RS<br><br><hr>Date&#58; Wed, 22 Jun 2011 16&#58;30&#58;47 -0400<br>From&#58; bobn@rogers.com<br>To&#58; seaside@lists.squeakfoundation.org<br>Subject&#58; [Seaside] jQuery toggle with a changing image<br><br><div>Hello,</div>I'm using a jQuery ajax script to toggle the display of a component. The anchor is initially displayed with a '+' png image. When clicked the hidden div is toggled and the anchor image is changed to a '-'. My code works, but I suspect it is not&nbsp;elegant. What I'd like to do to change the anchor image on each click (and the title), rather than the component replacement I'm doing now. &nbsp;I tried toggling the class of the anchor div to show different background images, but I could not get that to work (it feels like it should be easy).<div>
<br></div><div>Here is what I'm doing now... ('entireContact' is a pre-formatted view of all contact fields in a contact list application).</div><div>I'd prefer a solution that does not use a server call, which the #html&#58; method requires.</div>
<div><br></div><div>Thanks for any help,</div><div>Bob</div><div>&nbsp;</div><div><br></div><div><div>renderContactToggleOn&#58; html</div><div><br></div><div><span class=ecxApple-tab-span style="white-space&#58;pre">        </span>html div id&#58; 'contactToggle'; with&#58; [</div>
<div><span class=ecxApple-tab-span style="white-space&#58;pre">                </span>self renderContactMoreOn&#58; html].</div></div><div><br></div><div><br></div><div><div>renderContactMoreOn&#58; html</div><div><br></div><div><span class=ecxApple-tab-span style="white-space&#58;pre">        </span>html anchor&nbsp;</div>
<div><span class=ecxApple-tab-span style="white-space&#58;pre">                </span>onClick&#58; (</div><div><span class=ecxApple-tab-span style="white-space&#58;pre">                        </span>html jQuery ajax script&#58; [&#58;s |&nbsp;</div><div><span class=ecxApple-tab-span style="white-space&#58;pre">                                </span>s &lt;&lt; (html jQuery id&#58; 'entireContact') toggle&#58; 0.3 seconds.</div>
<div><span class=ecxApple-tab-span style="white-space&#58;pre">                                </span>s &lt;&lt; (html jQuery id&#58; 'contactToggle') load html&#58; [&#58;r | self renderContactLessOn&#58; r]]);</div><div><span class=ecxApple-tab-span style="white-space&#58;pre">                </span>title&#58; 'Show all contact attributes';&nbsp;</div>
<div><span class=ecxApple-tab-span style="white-space&#58;pre">                </span>with&#58; [html image url&#58; TSwaFileLibrary / #morePng]. &nbsp;&quot; + &quot;</div></div><div><br></div><div><div><br></div><div>renderContactLessOn&#58; html</div><div>
<br></div><div><span class=ecxApple-tab-span style="white-space&#58;pre">        </span>html anchor&nbsp;</div><div><span class=ecxApple-tab-span style="white-space&#58;pre">                </span>onClick&#58; (</div><div><span class=ecxApple-tab-span style="white-space&#58;pre">                        </span>html jQuery ajax script&#58; [&#58;s |&nbsp;</div>
<div><span class=ecxApple-tab-span style="white-space&#58;pre">                                </span>s &lt;&lt; (html jQuery id&#58; 'entireContact') toggle&#58; 0.5 seconds.</div><div><span class=ecxApple-tab-span style="white-space&#58;pre">                                </span>s &lt;&lt; (html jQuery id&#58; 'contactToggle') load html&#58; [&#58;r | self renderContactMoreOn&#58; r]]);</div>
<div><span class=ecxApple-tab-span style="white-space&#58;pre">                </span>title&#58; 'Hide contact attributes';&nbsp;</div><div><span class=ecxApple-tab-span style="white-space&#58;pre">                </span>with&#58; [html image url&#58; TSwaFileLibrary / #lessPng]. &nbsp;&quot; - &quot;</div>
<div><br></div></div>
<br>_______________________________________________
seaside mailing list
seaside@lists.squeakfoundation.org
http&#58;//lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside                                               </div></body>
</html>