Browse Source

Textbook: Update JavaScript to replace window.load event with document.ready, as a work-around for an issue with the ads JavaScript. Also removed styles/JavaScript that hid the body tag until page load was completed as it didn't entirely seem necessary in this case. See #108.

Laurel Fulford 7 years ago
parent
commit
faa6e8a59c
2 changed files with 1 additions and 11 deletions
  1. 1 6
      textbook/assets/js/functions.js
  2. 0 5
      textbook/style.css

+ 1 - 6
textbook/assets/js/functions.js

@@ -39,7 +39,7 @@
 	$( '.entry-footer' ).after( jQuery( '#jp-post-flair, .geo-post, .entry-content > .sharedaddy' ).detach() );
 
 	// On Load
-	$window.load( function() {
+	$( document ).ready( function() {
 
 		// Init Testimonials Carousel
 		testimonials.flexslider({
@@ -53,11 +53,6 @@
 			nextText: '<span class="screen-reader-text">Next</span><svg version="1.1" id="next-icon" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 16 16" xml:space="preserve"><polygon points="8,12.7 1.3,6 2.7,4.6 8,9.9 13.3,4.6 14.7,6 "/></svg>'
 		});
 
-		// Fade in body
-		wrapper.animate({
-			opacity: 1,
-		}, 30);
-
 		// Triggers resize event to make sure video widgets in the footer maintain the correct aspect ratio
 		setTimeout( function(){
 			if ( typeof( Event ) === 'function' ) {

+ 0 - 5
textbook/style.css

@@ -1597,11 +1597,6 @@ body {
   /* Fallback for when there is no custom background color defined. */
 }
 
-/* Fade in page after js loads */
-.js body {
-  opacity: 0;
-}
-
 /*--------------------------------------------------------------
 ## Content
 --------------------------------------------------------------*/