Link to home
Start Free TrialLog in
Avatar of Robert Granlund
Robert GranlundFlag for United States of America

asked on

jQuery Toggel Close all

I have this jQuery function that toggles open divs when a certain class is clicked:
<script>
jQuery(document).ready(function() {
	jQuery('.laser-nav-display').click(function() {
		jQuery('.nav-lasers').slideToggle("slow", function() {
			
		});
	});
	jQuery('.app-nav-display').click(function() {
		jQuery('.nav-applications').slideToggle("slow", function() {
			
		});
	});
	jQuery('.support-nav-display').click(function() {
		jQuery('.nav-support').slideToggle("slow", function() {
			
		});
	});
	jQuery('.company-nav-display').click(function() {
		jQuery('.nav-company').slideToggle("slow", function() {
			});
		});
	jQuery('.accept').click(function() {
		jQuery('.agreement').show("slow", function() {
			
		});
	});
});
</script>

Open in new window

However, when I click on one, I want the others to close instead oe.staing open. So there is only one open at a time.  How do I go about this?
ASKER CERTIFIED SOLUTION
Avatar of chaau
chaau
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial