Created
June 2, 2016 22:18
-
-
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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