Well... that was way too easy ;-)<div><br></div><div>Thanks,</div><div>Bob<br><br><div class="gmail_quote">On Wed, Jun 22, 2011 at 5:02 PM, Robert Sirois <span dir="ltr">&lt;<a href="mailto:watchlala@hotmail.com">watchlala@hotmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">



<div><div dir="ltr">Pop both anchors in there and do a show/hide. I think there&#39;s a toggle for hidden in there somewhere too.<br><br>RS<br><br><hr>Date: Wed, 22 Jun 2011 16:30:47 -0400<br>From: <a href="mailto:bobn@rogers.com" target="_blank">bobn@rogers.com</a><br>
To: <a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br>Subject: [Seaside] jQuery toggle with a changing image<div><div></div><div class="h5"><br><br><div>Hello,</div>
I&#39;m using a jQuery ajax script to toggle the display of a component. The anchor is initially displayed with a &#39;+&#39; png image. When clicked the hidden div is toggled and the anchor image is changed to a &#39;-&#39;. My code works, but I suspect it is not elegant. What I&#39;d like to do to change the anchor image on each click (and the title), rather than the component replacement I&#39;m doing now.  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&#39;m doing now... (&#39;entireContact&#39; is a pre-formatted view of all contact fields in a contact list application).</div><div>I&#39;d prefer a solution that does not use a server call, which the #html: method requires.</div>

<div><br></div><div>Thanks for any help,</div><div>Bob</div><div> </div><div><br></div><div><div>renderContactToggleOn: html</div><div><br></div><div><span style="white-space:pre-wrap">        </span>html div id: &#39;contactToggle&#39;; with: [</div>

<div><span style="white-space:pre-wrap">                </span>self renderContactMoreOn: html].</div></div><div><br></div><div><br></div><div><div>renderContactMoreOn: html</div><div><br></div><div><span style="white-space:pre-wrap">        </span>html anchor </div>

<div><span style="white-space:pre-wrap">                </span>onClick: (</div><div><span style="white-space:pre-wrap">                        </span>html jQuery ajax script: [:s | </div><div><span style="white-space:pre-wrap">                                </span>s &lt;&lt; (html jQuery id: &#39;entireContact&#39;) toggle: 0.3 seconds.</div>

<div><span style="white-space:pre-wrap">                                </span>s &lt;&lt; (html jQuery id: &#39;contactToggle&#39;) load html: [:r | self renderContactLessOn: r]]);</div><div><span style="white-space:pre-wrap">                </span>title: &#39;Show all contact attributes&#39;; </div>

<div><span style="white-space:pre-wrap">                </span>with: [html image url: TSwaFileLibrary / #morePng].  &quot; + &quot;</div></div><div><br></div><div><div><br></div><div>renderContactLessOn: html</div><div>
<br></div><div><span style="white-space:pre-wrap">        </span>html anchor </div><div><span style="white-space:pre-wrap">                </span>onClick: (</div><div><span style="white-space:pre-wrap">                        </span>html jQuery ajax script: [:s | </div>

<div><span style="white-space:pre-wrap">                                </span>s &lt;&lt; (html jQuery id: &#39;entireContact&#39;) toggle: 0.5 seconds.</div><div><span style="white-space:pre-wrap">                                </span>s &lt;&lt; (html jQuery id: &#39;contactToggle&#39;) load html: [:r | self renderContactMoreOn: r]]);</div>

<div><span style="white-space:pre-wrap">                </span>title: &#39;Hide contact attributes&#39;; </div><div><span style="white-space:pre-wrap">                </span>with: [html image url: TSwaFileLibrary / #lessPng].  &quot; - &quot;</div>

<div><br></div></div>
<br></div></div>_______________________________________________
seaside mailing list
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a>                                               </div></div>
<br>_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br></blockquote></div><br></div>