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"><<a href="mailto:watchlala@hotmail.com">watchlala@hotmail.com</a>></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'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'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 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. 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: 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: 'contactToggle'; 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 << (html jQuery id: 'entireContact') toggle: 0.3 seconds.</div>
<div><span style="white-space:pre-wrap">                                </span>s << (html jQuery id: 'contactToggle') load html: [:r | self renderContactLessOn: r]]);</div><div><span style="white-space:pre-wrap">                </span>title: 'Show all contact attributes'; </div>
<div><span style="white-space:pre-wrap">                </span>with: [html image url: TSwaFileLibrary / #morePng]. " + "</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 << (html jQuery id: 'entireContact') toggle: 0.5 seconds.</div><div><span style="white-space:pre-wrap">                                </span>s << (html jQuery id: 'contactToggle') load html: [:r | self renderContactMoreOn: r]]);</div>
<div><span style="white-space:pre-wrap">                </span>title: 'Hide contact attributes'; </div><div><span style="white-space:pre-wrap">                </span>with: [html image url: TSwaFileLibrary / #lessPng]. " - "</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>