Skip to content

Instantly share code, notes, and snippets.

@robwent
Created June 2, 2016 22:18
Show Gist options
  • Save robwent/c45d05c18061978c45cf7aac9357b9bf to your computer and use it in GitHub Desktop.
Save robwent/c45d05c18061978c45cf7aac9357b9bf to your computer and use it in GitHub Desktop.
Checks if the joomlaworks disqus plugin is loaded on the page and triggers a window resize event when the content has loaded. For any template that uses an equal heights script where the comments show over the footer.
jQuery(document).ready(function(){
if(jQuery('.jwDisqusForm')){
var interval = setInterval(function() {
var disqusHeight = jQuery('#disqus_thread').height();
if ( disqusHeight > 52 ) { //The header is 52px high so any higher and the content is loaded
jQuery(window).trigger('resize');
clearInterval(interval);
}
}, 100);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment