jquery - Collapse and expand all -
I am trying to expand / collapse all the functionality I have a list of expandable items, the top right With a button that allows users to expand and collapse everything.
Currently, my code works if everything increases / collapses, but does not work properly when the user expands certain elements (and not all) it only collapsed / expanded Switching Elements
Here is my jQuery code that is running:
$ ('div.srcprojects'). Hide (); $ ('. Projectscontainer'). ("Click", "span.destproject", function () {$ (this) .siblings ('.srcprojects') toggle () .inter (.). Siblings ('div' ("click", "div ("Click"); $ (this) .Parent "Span # expandcollapse", function () {$ (this) .text (function (i, current text) {current text on current === 'expand all'? 'Collapse all': 'expand all ("Click");}); How can I make it / Sus So that my #expressed calculation really can expand to everyone / everyone collapses?
Without fully detecting my code, I just want to tell that the jQuery toggle method simply show to hide and vice versa. If you want to toggle only one direction, then you can: to show (correct) and show the .toggle (false )
Comments
Post a Comment