$(document).ready(function(){ /* this code is executed after the dom has been completely loaded */ /* changing thedefault easing effect - will affect the slideup/slidedown methods: */ $.easing.def = "easeoutbounce"; /* binding a click event handler to the links: */ $('li.button a').click(function(e){ /* finding the drop down list that corresponds to the current section: */ var dropdown = $(this).parent().next(); /* closing all other drop down sections, except the current one */ $('.dropdown').not(dropdown).slideup('slow'); dropdown.slidetoggle('slow'); /* preventing the default event (which would be to navigate the browser to the link's address) */ e.preventdefault(); }) });