I think this is not very perfect. what do you think of this? $(document).ready(function(){ $("#thing").toggle(function(){ function () { $("#resultsview").removeClass('list').addClass('gallery'); }, function () { $("#resultsview").removeClass('gallery').addClass('list'); }); });
On 11 Sep., 16:53, seangates <[EMAIL PROTECTED]> wrote: > Rewritten: > > ----------------------------------------------------------------------- > > <style> > .gallery {background:red;} > .list {background:green;} > </style> > > <script language="javascript" type="text/javascript"> > $(document).ready(function(){ > $("#thing").click(function(){ > $("#resultsview").toggle( > function () { > $("#resultsview").removeClass('list'); > $("#resultsview").addClass('gallery'); > }, > function () { > $("#resultsview").removeClass('gallery'); > $("#resultsview").addClass('list'); > }); > });}); > > </script> > > <p id="thing">click</p> > <ul id="resultsview" class="list"> > <li>blah</li> > <li>blah</li> > </li> > > ----------------------------------------------------------------------- > > Haven't tested it, but I think this is the right direction. Hope that > helps.