Last active
April 27, 2018 12:01
-
-
Save Pageboy/b59ac0d82c57bb3bd78f7fc2a42df97d to your computer and use it in GitHub Desktop.
If you have a scroller across a spread
This file contains 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
// run this once the page has loaded | |
window.onload = function(){ | |
// find out if there is more than one scroller div over the spread | |
scrollers = document.getElementsByClassName("scroller").length; | |
if (scrollers > 1) { | |
var css = document.createElement("style"); | |
css.type = "text/css"; | |
// hide the second main div of the body | |
// make the width of the first main div the same as the viewport | |
css.innerHTML = "body > div:nth-child(2) .scroller {display:none;} body > div:nth-child(1) {width:732px !important; z-index: 100}" | |
// write this css to the head of the page | |
document.body.appendChild(css); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment