Post by jwreid » Sun Apr 22, 2018 2:16 am

I was not able to get a response from the developer so I came here. I have a FAQ page and when it opens the faqs are all expanded (questions and answers). I would like for it to be collapsed so that the customer expands only the questions he is interested in. I pasted the code I believe to be responsible for it. I am hoping someone could tell me how to modify so that the faqs start collapsed.
Thank you. ;D

<script type="text/javascript"><!--
$('.faq-block .faq-heading').bind('click', function() {
$(".faq-content").slideUp("slow");
$(".faq-heading").removeClass('active');

if ($(this).parent().find('.faq-content').is(":visible")) {
$(this).parent().find('.faq-content').slideUp('slow');
} else {
$(this).parent().find('.faq-content').slideDown('slow');
$(this).addClass('active');
}

User avatar
Active Member

Posts

Joined
Sun Oct 27, 2013 6:27 pm
Location - Canada

Post by cyclops12 » Sun Apr 22, 2018 7:18 pm

Might help if you had a link to your site.
But have you tried changing

Code: Select all

if ($(this).parent().find('.faq-content').is(":visible")) {
$(this).parent().find('.faq-content').slideUp('slow');
} else {
$(this).parent().find('.faq-content').slideDown('slow');
$(this).addClass('active');
}
To this ?

Code: Select all

if ($(this).parent().find('.faq-content').is(":visible")) {
$(this).parent().find('.faq-content').slideUp('slow');
$(this).addClass('active');
} else {
$(this).parent().find('.faq-content').slideDown('slow');
}

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by jwreid » Mon Apr 23, 2018 12:49 am

Thanks so much, but unfortunately it did not work. Here is my link. I hope it helps. thanks
https://www.ziivanwatches.com/frequentl ... -questions

User avatar
Active Member

Posts

Joined
Sun Oct 27, 2013 6:27 pm
Location - Canada

Post by cyclops12 » Tue Apr 24, 2018 1:19 am

Could you paste the code for the faq page ?

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am

Post by jwreid » Tue Apr 24, 2018 1:37 am

Sure, there are 2 tpl files "faq_info" and "faq_list" :
Thank you.
FAQ_INFO:

<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
<div class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
<?php } ?>
</div>
<h1><?php echo $heading_title; ?></h1>
<?php echo $description; ?>
<?php if ($faqs) { ?>
<div class="faq-list">
<div class="faqs-content">
<div class="faq-block">
<?php foreach ($faqs as $faq) { ?>
<div>
<div class="faq-heading" ><?php echo $faq['title']; ?></div>
<div class="faq-content" id="<?php echo $faq['faq_id']; ?>"><?php echo $faq['description']; ?></div>
</div>
<?php } ?>
</div>
</div>
</div>
<div class="pagination"><?php echo $pagination; ?></div>
<?php } else { ?>
<div class="content"><?php echo $text_empty; ?></div>
<div class="buttons">
<div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
</div>
<?php }?>
<?php echo $content_bottom; ?></div>
<script type="text/javascript"><!--
$('.faq-block .faq-heading').bind('click', function() {
$(".faq-content").slideUp("slow");
$(".faq-heading").removeClass('active');

if ($(this).parent().find('.faq-content').is(":visible")) {
$(this).parent().find('.faq-content').slideUp('slow');
} else {
$(this).parent().find('.faq-content').slideDown('slow');
$(this).addClass('active');
}
});
//--></script>
<?php echo $footer; ?>

FAQ_LIST:

<?php echo $header; ?><?php echo $column_left; ?><?php echo $column_right; ?>
<div id="content"><?php echo $content_top; ?>
<div class="breadcrumb">
<?php foreach ($breadcrumbs as $breadcrumb) { ?>
<?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
<?php } ?>
</div>
<h1><?php echo $heading_title; ?></h1>
<?php if (count($faqcategories)) { ?>
<?php foreach ($faqcategories as $category) { ?>
<div class="faq-list">
<div class="faq-heading"><h2><?php echo $category['title']; ?><a id="<?php echo $category['title']; ?>"></a></h2></div></br>
<div class="faqs-content">
<div class="faq-block">
<?php if (count($category['faqs'])) { ?>
<?php foreach ($category['faqs'] AS $faq) { ?>
<div>
<div class="faq-heading" ><?php echo $faq['title']; ?></div>
<div class="faq-content" id="<?php echo $faq['faq_id']; ?>"><?php echo $faq['description']; ?></div>
</div>
<?php } ?>
<?php } ?>
</div>
</div>
</div>
<?php } ?>
<?php } else { ?>
<div class="content"><?php echo $text_empty; ?></div>
<div class="buttons">
<div class="right"><a href="<?php echo $continue; ?>" class="button"><span><?php echo $button_continue; ?></span></a></div>
</div>
<?php } ?>
<?php echo $content_bottom; ?></div>
<script type="text/javascript"><!--
$('.faq-block .faq-heading').bind('click', function() {
$(".faq-content").slideUp("slow");
$(".faq-heading").removeClass('active');

if ($(this).parent().find('.faq-content').is(":visible")) {
$(this).parent().find('.faq-content').slideUp('slow');
} else {
$(this).parent().find('.faq-content').slideDown('slow');
$(this).addClass('active');
}
});
//--></script>
<?php echo $footer; ?>

User avatar
Active Member

Posts

Joined
Sun Oct 27, 2013 6:27 pm
Location - Canada

Post by cyclops12 » Thu Apr 26, 2018 5:29 am

Unless someone has the same extension to check then your only help will be from the developer I'm afraid

Expert Member

Posts

Joined
Sun Sep 27, 2015 1:10 am
Who is online

Users browsing this forum: edkny and 121 guests