Skip to content
This repository has been archived by the owner on Feb 17, 2025. It is now read-only.

Commit

Permalink
Textbook: Update JavaScript to replace window.load event with documen…
Browse files Browse the repository at this point in the history
…t.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.
  • Loading branch information
laurelfulford committed May 1, 2018
1 parent 83c4451 commit faa6e8a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
7 changes: 1 addition & 6 deletions textbook/assets/js/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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' ) {
Expand Down
5 changes: 0 additions & 5 deletions textbook/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------------------------------------------------------------*/
Expand Down

0 comments on commit faa6e8a

Please sign in to comment.