jQuery code snippet to make an options bar slider which can be toggled up and down to show options for a tool or such. It changes the arrow image when the animation ends.

Online Demo

	var optionsToggleBtn = $('#options_btn');
	var buttonState = 1; //open
	optionsToggleBtn.live('click', function(){
		$('#options').slideToggle('slow' , function(){
			if (buttonState == 1) {
				buttonState = 0;
			} else { 
				buttonState = 1;
Sam Deering is a Front-end Web Developer who specialises in JavaScript & jQuery. Sam is driven and passionate about sharing his knowledge to educate others.

Free Guide:

How to Choose the Right Charting Library for Your Application

How do you make sure that the charting library you choose has everything you need? Sign up to receive this detailed guide from FusionCharts, which explores all the factors you need to consider before making the decision.

  • http://www.homepage-individuell.de thomas108

    Hi, the link to the online demo is wrong. It currently goes to the json tree viewer.

  • jquery4u

    Hi Thomas, Yes this is the correct demo. The options toolbar can be opened and closed using the green arrow on the right of the JSON Tree Viewer. Cheers. Sam

Special Offer
Free course!

Git into it! Bonus course Introduction to Git is yours when you take up a free 14 day SitePoint Premium trial.