2017-07-24 32 views
0

我想将我的页脚常见问题解答问题链接到另一页上的特定手风琴面板。所以基本上我只是想让我的页脚faq链接打开它在faq页面上绑定的问题。Divi主题集成jQuery手风琴外部链接

HTML(页脚链接):

<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> 

所以,当我点击这些链接,它只能打开手风琴第二面板。所以它在一定程度上工作,但每个链接只打开第二个面板。

这里是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> 

回答

0

您可以用以下解决方案的所有功能

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

请检查该解决方案。

+0

还是,做同样的事情。 – JontheNerd