Home  >  Article  >  Web Front-end  >  jquery super simple way to achieve accordion effect

jquery super simple way to achieve accordion effect

PHPz
PHPzOriginal
2016-05-16 15:56:06975browse

The example in this article describes the super simple method of realizing the accordion effect in jquery. Share it with everyone for your reference. The core code is as follows:

$("#accordion .expanded").hide();
$("a.opening").click(function(){
  $(this).next().slideToggle('fast', function(){
    $(this).prev("a.opening").toggleClass("active");
    });
  return false;
});

I hope this article will be helpful to everyone’s jQuery programming.

For more related tutorials, please visit JavaScript Tutorial

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn