Site logo

Archived topic

Uncaught reference error

2 replies · Started by fabien on June 22, 2020

Viewing posts 1–3 of 3

Hi there,

I believe a recent update of GP Premium created a glitch on my home page. A button 'Yes Please' is meant to reveal hidden tabs with the following javascript elements but I am now getting an error. I thought it may be Autoptimize or Cloudflare Rocket Loader but after deactivating these two, it still isn't working.

When I remove the elements, the error disappears, but the buttons still aren't working...

<script>
	(function() {
jQuery('.toggle-button .fl-button').on('click', function(e){
if ( jQuery('.toggle-section').is(':hidden') ) {
jQuery('.toggle-section').css('display', 'block');
} else {
jQuery('.toggle-section').css('display', 'none');
}
});
})(jQuery);
</script>
and 

<script>
jQuery(document).ready(function($) {

$(".toggle-button a").on("click",function(e){

// Reset all columns visibility
$("[class*='toggle-section-']").hide();

// Get target from clicked button attribute
var target = $(this).closest(".toggle-button").attr('target');

// Toggle target visibility
$('.' + target).fadeToggle();

// Disable links
e.preventDefault();

});

});
</script>

Sorry ignore my request :) This was caused by another plugin whose hide/show function uses the same js reference.

Glad you've figured out :)

This archived topic is closed to new replies.