Accordion Expand

rss

Posted by ksertkaya - Nov 18 ’15 at 03:13

Hello,

I have an accordion in form. When I open this form, all tabs expand except first tab. How do I expand first tab when I open this form?

http://prntscr.com/941zcf

 

Here's my current code:


$('#fd_accordion-0 > h3:eq(0)').click()

$('#fd_accordion-0 > h3:eq(1)').click()

$('#fd_accordion-0 > h3:eq(2)').click()

$('#fd_accordion-0 > h3:eq(3)').click()

$('#fd_accordion-0 > h3:eq(4)').click()

 

Thanks.

  • rostislav
    rostislav
    Moderator
    Member for: 4 years 9 months 20 days
    #1 by rostislav Nov 18 ’15 at 06:12

    Hi!

    You have 4 tabs in the accordion, but are trying to expand 5. The last line in fact initiates a click on the first tab. Remove the last line and you'll be fine.

  • ksertkaya
    Member
    Member for: 4 years 3 months 8 days
    #2 by ksertkaya Nov 18 ’15 at 07:46

    Hi,

    Fifth tab doesn't seem in that picture smile

    http://prntscr.com/944add

  • rostislav
    rostislav
    Moderator
    Member for: 4 years 9 months 20 days
    #3 by rostislav Nov 18 ’15 at 08:16

    [#2]:

    Show the code that you're using with that accordion.

  • ksertkaya
    Member
    Member for: 4 years 3 months 8 days
    #4 by ksertkaya Nov 18 ’15 at 08:30

    [#3]:

    I use just that code for accordion. Do I have to use another code for accordion?

  • rostislav
    rostislav
    Moderator
    Member for: 4 years 9 months 20 days
    #5 by rostislav Nov 18 ’15 at 08:53

    [#4]:

    OK, this is happening because one of the tabs (in this case - the first one) is opened by default, so what you're doing is closing it. Probably best you just set which tabs are opened by default in Forms Designer. Go to Forms Designer, select the accordion, look to the right, you'll see the "Expanded" field. Enumerate here all your tabs, starting from 0, like this:

    0,1,2,3,4

  • ksertkaya
    Member
    Member for: 4 years 3 months 8 days
    #6 by ksertkaya Nov 18 ’15 at 09:21

    [#5]:

    Thank you very much  rostislav !

  • lijupnandanan
    Member
    Member for: 3 years 10 months 13 days
    #7 by lijupnandanan Apr 19 ’16 at 07:18

    Hi,
    By default when I cleck new form , The first accordion tab will be expanded. i need to collapse every tab on New form and need to expand only when I clicked the tab. how can I resolve this?
    I added  this on Page load
    $('#fd_accordion-0 > h3:eq(0)').click()

    But its not working

  • Dmitry Kozlov
    Dmitry Kozlov
    Admin
    Member for: 6 years 5 months 5 days
    #8 by Dmitry Kozlov Apr 19 ’16 at 07:53

    [#7]: Open the designer, select the Accordion, and clear the Expanded property. Then clear cookies.

  • lijupnandanan
    Member
    Member for: 3 years 10 months 13 days
    #9 by lijupnandanan Apr 19 ’16 at 08:00

    Still Not working. I didnt enter any tab index on Expanded property an I cleared the cookies.
    Issues on
    1. Click New form expand first tab and then click cancel button.

    2. Again click New form , Now the first tab is expanded without clicking on it.

    But when we collapsed all tab and click cance button and again click new form all tabs are in collapsable. Thats the issue smile

  • rostislav
    rostislav
    Moderator
    Member for: 4 years 9 months 20 days
    #10 by rostislav Apr 19 ’16 at 08:31

    [#9]:

    Set the accordion's mode to singleCollapsible or Multiple and add the following code to the page:

     $(window).unload(function(){
    	var i = 0;
    	while($.removeCookie('fd_accordion-'+i)) {
    		i++;
    	}
    });
Displaying 1 to 10 of 13 messages
Previous12