diff --git a/js/jquery.slabtext.js b/js/jquery.slabtext.js index 278385c..86bfb84 100644 --- a/js/jquery.slabtext.js +++ b/js/jquery.slabtext.js @@ -78,6 +78,11 @@ // Cache the parent containers width var parentWidth = $this.width(), fs; + + //Sanity check to prevent infinite loop + if ( parentWidth === 0 ) { + return; + } // Remove the slabtextdone and slabtextinactive classnames to enable the inline-block shrink-wrap effect $this.removeClass("slabtextdone slabtextinactive"); @@ -237,4 +242,4 @@ }; }); }; -})(jQuery); \ No newline at end of file +})(jQuery);