Tagged: x
-
AuthorPosts
-
December 8, 2016 at 5:41 am #1285928
slking1989ParticipantHi,
I am trying to use a button to open an accordian. So far i have found the following code which will take me to the accordian on the page. However this will not open a collapsed accordian and i cannot find the correct JS to do this.
Any help will be appreciated
jQuery(document).ready(function($) { $('.open_accordion').click(function(e) { var $this = $(this); var thisHref = $this.attr('href'); var accordion = $(thisHref).find('.x-accordion-toggle'); if ( accordion.length && $(thisHref).hasClass('x-accordion-group') ) { e.preventDefault(); accordion.trigger('click'); } });December 8, 2016 at 5:42 am #1285929
slking1989ParticipantHelp 🙂
December 8, 2016 at 7:37 am #1286025
Paul RModeratorHi,
Thanks for writing in! To assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.
December 8, 2016 at 10:39 am #1286249
slking1989ParticipantDecember 8, 2016 at 1:12 pm #1286439
RahulModeratorHi,
Thank you for providing your url.
To make it work on your prompt’s button, you can change the javascript code to this.
jQuery(document).ready(function($) { $('.open_accordion .x-btn').click(function(e) { var $this = $(this); var thisHref = $this.attr('href'); var accordion = $(thisHref).find('.x-accordion-toggle'); if ( accordion.length && $(thisHref).hasClass('x-accordion-group') ) { e.preventDefault(); accordion.trigger('click'); } }); });Hope that helps.
December 9, 2016 at 2:05 pm #1287704
slking1989ParticipantUnfortunatly that did not help.
That code also looks very familiar to the one i said i am trying.
December 9, 2016 at 8:48 pm #1288046
Rue NelModeratorHello There,
Sorry if it doesn’t work out for you. please have the JS code updated and use this instead:
jQuery(document).ready(function($) { $('.open-accordian.x-btn').click(function(e) { var $this = $(this); var thisHref = $this.attr('href'); var accordion = $(thisHref).find('.x-accordion-toggle'); console.log(thisHref); e.preventDefault(); accordion.trigger('click'); }); });We would loved to know if this has work for you. Thank you.
December 13, 2016 at 5:04 am #1291122
slking1989ParticipantUnfortunately it did not work.
December 13, 2016 at 6:33 am #1291198
Paul RModeratorHi,
I no longer see a button on this page – http://fm-factory.com/download/vitrex-1-3/
Can you create another test page with your button and accordion.
Thanks
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1285928 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
