hey guys,
excuse me if i sound really really clueless in this post - i’m not a developer and this is my first attempt at designing a website since 6th grade, so please bear with me.
i am attempting to build a landing page with two different little widgets on it:
an FAQ accordion widget (https://websales.gumroad.com/l/unbounce-accordion-faq)
a carousel for testimonials
my problem is - i cannot get both working at the same time. i did some quick google searching and realized it may be because i was trying to run two different versions of jQuery. so, i updated the javascript of the jQuery for the testimonial carousel to be the same version of jQuery as the accordion widget - still no luck.
when i remove the FAQ accordion javascript - the testimonial widget works. when i remove the testimonial widget - the FAQ accordion works.
is there a clean way to integrate both of these?
here is the javascript code for the FAQ:
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script>
$.fn.accordion=function(){return this.each(function(){var e=this;this.accordionHeight=$(e).height(),this.acc_wrapper=$(e).closest(".lp-element"),this.acc_wrap_height=e.acc_wrapper.height(),this.acc_top=e.acc_wrapper.position().top,this.blocks1=b],this.acc_block="",$(".lp-positioned-content>.lp-element").each(function(c,t){!$(t).is(e.acc_wrapper)&&$(t).position().top>e.acc_top&&e.blocks1.push(t)}),$("#lp-pom-root>.lp-element").each(function(c,t){var i=$(t).position().top;if(i<e.acc_top&&i+$(t).height()>e.acc_top)return e.acc_block=$(t),!1}),this.collapse_page=function(){var c=$(e).height(),o=c-e.accordionHeight;e.accordionHeight=c,e.acc_wrap_height<c?e.acc_wrapper.height(c):e.acc_wrapper.height(e.acc_wrap_height),e.acc_block.height(e.acc_block.height()+o),e.acc_block.find("div").each(function(c,t){$(t).height($(t).height()+o)}),$.each(e.blocks1,function(c,t){var i=$(t).position().top+o;$(t).css("top",i+"px")})},$(e).find(".collapsed").each(function(){let c=$(this).closest(".card").find(".collapse");c.css("max-height",ce0].scrollHeight),setTimeout(function(){e.collapse_page()},100)}),$(this).on("click",".btn-link",function(){let c=$(this).closest(".card").find(".collapse");$(e).find(".collapse").css("max-height",""),$(this).hasClass("collapsed")||($(e).find(".btn-link").removeClass("collapsed"),c.css("max-height",ce0].scrollHeight)),$(this).toggleClass("collapsed"),setTimeout(function(){e.collapse_page()},100)})})},$(".j-accordion").accordion();
</script>
and here is the javascript code for the testimonial widget:
<script
src="https://code.jquery.com/jquery-3.5.1.min.js"
integrity="sha256-9/aliU8dGd2tb6OSsuzixeV4y/faTqgFtohetphbbj0="
crossorigin="anonymous"></script>
thank you so much!
marc