不要让手风琴与 js 一起工作



我的页面没有显示手风琴:

<script type='text/javascript' src='http://mendert.nl/zeeuwseknop/wp-content/themes/food-cook/includes/js/jquery-ui-1.9.2.custom.js?ver=1.9.2'></script>
<script type='text/javascript' src='http://mendert.nl/zeeuwseknop/wp-includes/js/jquery/jquery.js?ver=1.10.2'></script> 
<script type='text/javascript' src='http://mendert.nl/zeeuwseknop/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1'></script>
这是我的js
/*content accordion*/
$('.accordion').each(function(){
    var acc = $(this).attr("rel") * 2;
    $(this).find('.accordion-inner:nth-child(' + acc + ')').show();
    $(this).find('.accordion-inner:nth-child(' + acc + ')').prev().addClass("active");
});
$('.accordion .accordion-title').click(function() {
    if($(this).next().is(':hidden')) {
        $(this).parent().find('.accordion-title').removeClass('active').next().slideUp(200);
        $(this).toggleClass('active').next().slideDown(200);
    } else {
        $(this).parent().find('.accordion-title').removeClass('active').next().slideUp(200);
    }
    return false;
});

我使用一个短代码通过我的php函数插入到我的页面:

// [container]
function accordion($atts, $content=null, $code) {
extract(shortcode_atts(array(
    'open' => '1',
    'title' => 'Title'
), $atts));
if (!preg_match_all("/(.?)[(accordion-item)b(.*?)(?:(/))?](?:(.+?)[/accordion-item])?(.?)/s", $content, $matches)) {
    return do_shortcode($content);
} 
else {
    $output = '';
    for($i = 0; $i < count($matches[0]); $i++) {
        $matches[3][$i] = shortcode_parse_atts($matches[3][$i]);
        $output .= '<div class="accordion-title"><a href="#">' . $matches[3][$i]['title'] . '</a></div><div class="accordion-inner">' . do_shortcode(trim($matches[5][$i])) .'</div>';
    }
    return '<h3 class="accordion_h3">'.$title.'</h3><div class="accordion" rel="'.$open.'">' . $output . '</div>';
}   

} '

可能您缺少这两个文件- markercluster .js和favico.js (404 Error),因此这些错误阻塞了您的手风琴

最新更新