Tag Archives: jQuery

Super Easy jQuery Accordion Menu

I created this accordion menu rather on accident. (See my previous post, ). I was actually writing jQuery to make a show/hide question answer list, and realized it would be really easy to turn it into an accordion menu.

Here’s the result: Continue reading

Show/hide function for questions and answers

Here’s a neat little script that allows a question and answer type format, where the questions are all listed as links, and clicking on one toggles the visibility of the corresponding answer. $(“p”).hide(); $(“a”).click(function () { $(this).next(“p:first”).slideToggle(“fast”); }); Here’s a … Continue reading

Using Variables in JQuery Selectors

If you want to use variables in combination with CSS-style selectors like so: $(“#navigation a.myHomePage, ” + logo).hover(function() { $(“li.home”).addClass(“homeRoll”); }, (function() { $(“li.home”).removeClass(“homeRoll”); }); Make sure your variable homePageImage is written as a string: var homePageImage = “#logo” not … Continue reading