Skip to content

Instantly share code, notes, and snippets.

@plavet
Created May 26, 2012 21:39
Show Gist options
  • Save plavet/2795425 to your computer and use it in GitHub Desktop.
Save plavet/2795425 to your computer and use it in GitHub Desktop.
Jquery - Simple Accordion
// `armonika
$('.armonika').hide();
$('.triger:first').addClass('active').next().show();
$('.triger').click(function(e){
if( $(this).next().is(':hidden') ) {
$('.triger').removeClass('active').next().slideUp();
$(this).toggleClass('active').next().slideDown();
}
else {
$(this).next().slideUp()
}
e.preventDefault();//funckija gornjih linkova ukinuta da bi mogla
}); //da se otvara na klik `armonika a ne strane
$('.menu-tribine-container ul.sub-menu li a').click(function(){
//vracam ponovo funkciju linkova inace ni pod linkovi nece otvarati strane na klik
window.location=$(this).attr("href"); return false;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment