Thanks for your replies, I appreciate it. I put the contents of gallery.js inside the click function and it appears to be working now. I had tried this before, but there must have been an unrelated syntax error or something that was causing it to break.
Thanks Andrew On Aug 9, 4:45 pm, Stephan Beal <sgb...@googlemail.com> wrote: > On Aug 9, 7:38 pm, "andrew.croce" <andrew.cr...@gmail.com> wrote: > > > What I was trying to do with var current_section = $(this).attr > > ("name"); was to create a variable that simply contained the "name" of > > the particular subsection, which I could then attach to "_tab" to > ... > > idea, could that be screwing up the whole file? or is the name > > attribute inaccessible to jquery? > > i see. No, it's not a bad idea, i was just confused by it. > > > The bigger problem, it seems, is that nothing is running in that > > gallery.js file, not even the first few lines... > > $(".current_panel .image_area").removeClass("current_area"); > > $(".current_panel .image_area").hide(); > > $(".current_panel .intro").show(); > > $(".current_panel .intro").addClass("current_area"); > > $(".back_tab").hide(); > > If you haven't done so yet, install Firebug and enable it for your > page. Then click the "Script --> Break on all Errors" option and > reload your script. If there's a syntax error or something which is > causing an silent failure, this will normally point you directly to > it. Other than that, i don't have any tips. > > > class .current_panel is added when a main menu btn is clicked, and the > > script for that is in the other panels.js file, which, as I said, is > > running perfectly. If all the javascript on the site is run on page > > load, then there is no .current_tab class at the time, and hence > > nothing will happen. > > That's right - selectors match only what's currently in the dom at the > moment (but the new livequery API can also catch future matches). It > sounds like you've found the problem.