Skip to content

Instantly share code, notes, and snippets.

@panzi
Last active August 29, 2015 13:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save panzi/10319120 to your computer and use it in GitHub Desktop.
Save panzi/10319120 to your computer and use it in GitHub Desktop.
The really strange thumbr theme you are using causes some very strange things.
It loads some other website in a "fullscreen" iframe that then in turn loads your
tumblr in another iframe. This causes the Browser Ponies JavaScript to be executed
twice, once in the toplevel frame and once in the inner most iframe. However the
ponies in the toplevel frame are somehow not visible, but they still cost CPU power.
Anyway, if you want to have the ponies always in the background, add this to the
source of your tumblr:
<style type="text/css">#content { position: relative; z-index: 100000000; }</style>
If you want to enable the "toggle ponies to background" function add this:
<script type="text/javascript">
function toggleBrowserPoniesToBackground () {
var content = jQuery("#content");
if (content.css("zIndex") === "100000000") {
content.css("zIndex", "auto");
}
else {
content.css("zIndex", "100000000");
}
}
</script>
Then a you can add a button somewhere to toggle the ponies:
<button type="button" onclick="BrowserPonies.togglePoniesToBackground();">Toggle
Browser Ponies to Background</button>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment