I want to create a page like
http://uhbvn.org.in/web/portal/faqs
With Expand and Collapse all link
Along with functionality of Individual Slide Toggle Feature
I already worked like http://yamunanagar.nic.in/g/FAQs.asp
But in this i have to create separate function for each toggle question

Thanks in advance

Recommended Answers

All 5 Replies

If I am in the case, I will probably wrap the question and answer in same div. Then use class instead of id, and bind the script to the class.
html:

<div>
    <div class="flip"></div>
    <div class="panel"></div>
</div>

script:

$(document).ready(function(){
    $(".flip").click(function(){
        $(this).sibling(".panel").slideToggle("slow");
    });
});

I tried this...But not working anymore...

<script>
    $(document).ready(function(){
        $(".flip").click(function(){
            $(this).sibling(".panel").slideToggle("slow");
        });
    });
</script>
<style> 
#panel, #flip {
    text-align: left;
    background-color:#FFF;
}

#panel {
    text-align:justify;
    display: none;
}
</style>
<div>
        <div class="flip">Question</div>
        <div class="panel">Answer</div>
    </div>

Do anyone help please

Can you please provide us with some code. Some of the HTML code if possible so we can help.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.