Chris2656882
Posts: 0
Joined: Fri May 11, 2012 3:47 pm

Expand/Contract Collapse Block with Javascript

I wish to dynamically collapse and expand a collapsible block.

I've used both:
Tiggr('collapsblock_options_holder').prop('data-collapsed', true) ;
Tiggr('collapsblock_options_holder').attr('data-collapsed', true) ;

However, the block does not collapse or expand.

Do I need to refresh the element? If so, how?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Expand/Contract Collapse Block with Javascript

Use:

code
Tiggr(id).trigger('expand');
/code

araskin3i
Posts: 0
Joined: Fri Dec 20, 2013 2:44 pm

Expand/Contract Collapse Block with Javascript

I just tried Appery(id).trigger('expand') but it does not work. Has this changed?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

Expand/Contract Collapse Block with Javascript

Hi,

You can use this code: preAppery("mobilecollapsblock_10").trigger("collapse");
Appery("mobilecollapsblock_10").trigger("expand");/pre

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Expand/Contract Collapse Block with Javascript

I tried the above and it doesn't seem to work. This is what I have with "collapseblockmatchopt" being at the top level of container.

Appery("collapseblockmatchopt").trigger("collapse");

Am I using the right level?

Thanks,
Aeneas

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Expand/Contract Collapse Block with Javascript

Hello Aeneas,

Please clarify, what version of libraries do you use? For v2.0 these methods should be working:
http://api.jquerymobile.com/collapsib...
http://api.jquerymobile.com/collapsib...

Aeneas McBurney
Posts: 0
Joined: Mon Jun 16, 2014 7:49 am

Expand/Contract Collapse Block with Javascript

Hi thanks for your prompt response.

I used Appery("collapseblockmatchopt").collapsible("collapse") and it worked like a charm.

Thanks again,
Aeneas

Return to “Issues”