Just a guess: are you defined that function inside $(document).ready () ? If you are, it's only available inside that scope, you should define it outside so it's declared globally. But a better approach is, like mike said, to use proper event binding instead of inline attributes. It's cleaner and easier to understand.
cheers, - ricardo On Mar 10, 6:31 pm, surreal5335 <surrea...@hotmail.c om> wrote: > I have been having trouble trying to define a function. I've tried > every idea I have come across on the internet but nothing worked. I > hope some one here has an of how to get it defined properly. > > The code that is not defined is: > > var currentUl = 1; > function showMe(n) { > $("ul#gallery").click(function(){ > $("#"+currentUl).hide(); > $("#"+n).show(); > $("div#picture").show(); > $("span#picture").show(); > $("img#space").hide(); > }); > > currentUl = n; > > }; > > This basic setup has worked for me in the past with just pure > javascript. > > The html I am using to call it is: > > onclick="showMe('3');" > > I am referencing the function with an: > > id="1" > > I would appreciate any help you can offer. > > Thanks a lot