Home >Web Front-end >JS Tutorial >jquery super simple way to achieve accordion effect
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