How he said is the better way, i think
$(".classLink").click( function(){ $(".classDetail").slideToggle("slow"); return false; }); On 5/23/07, Richard D. Worth <[EMAIL PROTECTED]> wrote:
On 5/23/07, tlob <[EMAIL PROTECTED]> wrote: > > [code] > $(document).ready(function(){ > $("#linkDetail1").click(function(){ > $("#detail1").slideToggle("slow"); > return false; > }); > > $("#linkDetail2").click(function(){ > $("#detail2").slideToggle("slow"); > return false; > }); > > $("#linkDetail3").click(function(){ > $("#detail3").slideToggle("slow"); > return false; > }); > } > [/code] $(["#linkDetail1", "#linkDetail2", "#linkDetail3"]).click(function(){ $(this).slideToggle("slow"); return false; }); > what if I have to extend the IDs #linkDetail4, #linkDetail5, ..... > > You'll likely want to find a different selector in that case. Maybe give them each the same class and use $(".className").click(... - Richard D. Worth
-- []´s Jean www.suissa.info Ethereal Agency www.etherealagency.com