This code is listed on the header of all of my webpages. When I click a link on my website, I'm unable to use the buttons on the page until after I refresh. How can I fix this?
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.faqElement').click(function() {
var faqElement = $(this);
var question = faqElement.find('.faqQuestion');
var answer = faqElement.find('.faqAnswer');
if (!answer.hasClass('activeFaqAnswer')) {
$('.faqElement').removeClass('flipButton');
faqElement.addClass('flipButton');
$('.activeFaqAnswer').css('max-height', '');
$('.faqAnswer').removeClass('activeFaqAnswer');
answer.css('max-height', 'none');
answer.css('max-height', answer.height());
answer.addClass('activeFaqAnswer');
}
});
});
</script>