[jQuery] Re: pass different IDs to function?

2009-08-19 Thread Liam Byrne
Did you wrap the tab click function in a document.ready, so that the tabs were there to apply the function to ? $(document).ready(function() { $(.tabs).click( function(){ var number = $(this).attr(id); $(.hiding).hide(); $(#div+ number).show();

[jQuery] Re: pass different IDs to function?

2009-08-19 Thread mkmanning
Numeric ID's aren't valid, and also an ID can't start with a number. I'd also recommend removing the inline onclick; you can simplify the code by just adding a click event on the UL and delegating: $('#tab_list').click(function(e){ e = $(e.target), i = $(this).find('li').removeClass

[jQuery] Re: pass different IDs to function?

2009-08-19 Thread Laura
Thank you all for the help! I'm still working on deciphering my way though mkmanning's suggestion (told ya I was very new at this) but I did get Liam's to work, and I'm continuing to try simplifying the code. I really appreciate the help!! Laura On Aug 19, 5:11 pm, mkmanning

[jQuery] Re: pass different IDs to function?

2009-08-18 Thread Mohd.Tareq
HI,var preId = null; function divFlip(Id) { $(#+preId).hide(); $(#+id).show(); preId = Id; $(.tabs).removeClass(highlight); $(#1).addClass(highlight); } div id=menu_tabs ul id=tab_list li id=1 class=tabs