简体   繁体   中英

JQuery Accordion content links don't work

New to JQuery and I am implementing accordion. I'm having issues with having more than one hyperlink in the content. Essentially I have one dropdown and a list of links. For some reason only the first hyperlink works. They are all hyperlinks and come up as so but only the first one is clickable. Anyone have some insight? This person had the same issue but the code he commented out doesn't exist in my js. Weird bug where links don't work in jquery 'tabs+accordion'

<script>
$(function() {
    $( "#accordion" ).accordion(
    {
        collapsible: true, active:false, header:"h3"}
    );      
    $( ".selector" ).accordion({ heightStyle: "fill" });
});

</script>

<div id ="accordion">   
        <h3> &nbsp </h3>
         <ul class="ui-accordion-container">
            <li><a class="accordion-label" href="#">this is a test blah blah blah</a></li>
            <li><a class="accordion-label" href="#">this is a test blah blah blah</a></li>
            <li><a class="accordion-label" href="#">this is a test blah blah blah</a></li>
        </ul>       
</div>

For me it was that containing div had styling of ::before which was displayed on top of my links and that's why there weren't clickable. Removing that styling did the job.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM