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

jquery super simple way to achieve accordion effect

PHPz
Release: 2018-10-12 15:26:24
Original
1027 people have browsed it

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;
});
Copy after login

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

For more related tutorials, please visit JavaScript Tutorial

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template