This file contains hidden or 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
// Given an iframe id and an anchor id that is present within the iframe, | |
// determine whether the element is visible/present inside the window viewport. | |
// This is not about the css 'display' property; this shows whether | |
// the window viewport contains the element. | |
var isVisible = function (anchor, iframe_id) { | |
var ifrId = iframe_id || 'bv_page'; | |
var ifrOffset = window.parent.document.getElementById(ifrId).offsetTop; | |
var myloc = document.getElementById(anchor).offsetTop + ifrOffset; | |
var viewtop = window.parent.scrollY; |
This file contains hidden or 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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |