jquery - Hide all unactive panels of a JuiAccordion when one is active -


I'm a jquery nut that just fell from the tree I used Yii to create a multi-view each form one The other is independent and everyone can be submitted using AJX.

I am using all different forms to capture and save screen space. But I feel that other forms (even in collapsed panels) just come in the way. That's why I want to achieve this: "Whenever it is active, all covered panels are hidden".

Activate me before active (Event, UI) or to get (Event, UI) but I do not know The active panel collapses in order to hide inactive panels to use some way to recycle acetian panels, and to show their counterparts again all the fallen panels.

In addition, how can I use these events to use Yi?

Well, after the research that I'm active (event, UI) or The first active (event, UI) I can do by using Yii ... I was unaware.

However, I have found an alternate solution to draw a callback using the html option, here's my CJuiAccordion render code:

  $ panels = array ("panel a "= & Gt;" The content goes here "," Panel B "= & gt;" The content goes here "," Panel C "= & gt;" The content goes here "); $ Cs = Yii :: app () - & gt; Classic script; // my required jquery function $ cs- & gt; Register script file ('js / accordion.js') has been announced; $ This- & gt; Widget ('zii.widgets.jui.CJuiAccordion', array ('panel' => gtc: $ panel, 'id' = & gt; 'inventory-estordian', 'option' => array ('compressed' = & Gt; true, 'active' => 1, 'heightStyle' = & gt; 'content',), 'htmlOptions' => array ('style' = 'gtc:' width: 100% ; ',' Onclick '= & gt;' Toggle Panels ("inventory-erordian", "H3") ',),));   

Good code goes here, js / accordion.js

  / ** * creates a jquery-ui-accordion Whenever a * is selected and displays all panels, then only all active panels are compressed * / function togglePanels (accordionId, headerSelector) {var accordion = $ ("#" + accordionId); Var accordionHeader = $ ("#" + accordionId + "& gt;" + Header Selector); Var active = accordion.accordion ("option", "active"); If (active! == incorrect) {// Alert (active); AccordionHeader.each (function (index) {if (index! = Active) $ (this) .slideUp ('slow');}); } Else {// Warning ("Show All Panels!"); AccordionHeader.each (function () {$ (this) .slideDown ('slow');}); }}   

I'm pretty sure this code is useful and can be teased for Yui users of Cui Accordion.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -