2017-07-24 4 views
0

Ich versuche meine Footer FAQ-Fragen zu bestimmten Akkordeon-Panels auf einer anderen Seite zu verknüpfen. Also im Grunde möchte ich nur meine Footer-FAQ-Links, um die Frage zu öffnen, an die es auf der FAQ-Seite gebunden ist.Divi Theme Integration jQuery Accordion Externe Links

HTML (Footer-Links):

<div class="footer-faq"> 
<a id="faq-link-1" href="http://accesshealth.lunabyte.io/faqs/#my 
accordion">What is Access 
Health?</a><br /> 
<a id="faq-link-2" href="http://accesshealth.lunabyte.io/faqs/#my- 
accordion">Who are the Access Health clinicians?</a><br /> 
<a id="faq-link-3" 
onclick="thing2();"href="http://accesshealth.lunabyte.io/faqs/#my- 
accordion"> Does it matter where my insurance cover is?</a><br /> 
<a id="faq-link-4" onclick="thing3();" 
href="http://accesshealth.lunabyte.io/faqs/#my-accordion"> Who can be 
treated at Access Health?</a><br /> 
<a id="faq-link-5" onclick="thing4();" 
href="http://accesshealth.lunabyte.io/faqs/#my-accordion"> Which conditions 
are treated at Access Health?</a><br /> 
<a id="faq-link-6" onclick="thing5();" 
href="http://accesshealth.lunabyte.io/faqs/#my-accordion"> What preventative 
services are provided?</a><br /> 
<a id="view-all" href="http://accesshealth.lunabyte.io/faqs/">View All</a> 
</div> 

Also, wenn ich auf einen dieser Links klicken, um es öffnet sich nur die zweite Platte in Harmonika. Es funktioniert also bis zu einem gewissen Grad, aber jeder Link öffnet nur das zweite Panel. Hier

ist die jQuery:

<script> 

jQuery(function thing($){ 
$(window).load(function(){ 
if(window.location.hash) { 
$('.et_pb_accordion_item_0 .et_pb_toggle_title').click(); 
} 
}); 
}); 

jQuery(function thing1($){ 
$(window).load(function(){ 
if(window.location.hash) { 
$('.et_pb_accordion_item_1 .et_pb_toggle_title').click(); 
} 
}); 
}); 

jQuery(function thing2($){ 
$(window).load(function(){ 
var et_hash = window.location.hash; 
if(window.location.hash) { 
$('.et_pb_accordion_item_2 .et_pb_toggle_title').click(); 
} 
}); 
}); 

jQuery(function thing3($){ 
$(window).load(function(){ 
var et_hash = window.location.hash; 
if(window.location.hash) { 
$('.et_pb_accordion_item_3 .et_pb_toggle_title').click(); 
} 
}); 
}); 

jQuery(function thing4($){ 
$(window).load(function(){ 
var et_hash = window.location.hash; 
if(window.location.hash) { 
$('.et_pb_accordion_item_4 .et_pb_toggle_title').click(); 
} 
}); 
}); 

jQuery(function thing5($){ 
$(window).load(function(){ 
var et_hash = window.location.hash; 
if(window.location.hash) { 
$('.et_pb_accordion_item_5 .et_pb_toggle_title').click(); 
} 
}); 
}); 

</script> 

Antwort

0

Sie unter Lösung für alle Funktion kann

$('.et_pb_accordion_item_4').children('.et_pb_toggle_title').click();

Bitte diese Lösung überprüfen.

+0

Immer noch das Gleiche. – JontheNerd