Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Provides the ability for the creative developer to specify a custom time interval for refreshing the informationvalues for size, position, and viewability. In addition, on iOS this call should enable NSRunLoopCommonModes on the NSTimer.

  • milliseconds: Integer value describing the time interval in milliseconds.

Example:

Code Block
<script src="mraid.js"></script>
<script type="text/javascript">
if (mraid.getState() == 'loading') {
    mraid.addEventListener('ready', onSDKReady);
} else {
    onSDKReady();
}

function onSDKReady() {
	if ((typeof window.anjam.SetMRAIDRefreshFrequency) !== "undefined") {
		anjam.SetMRAIDRefreshFrequency(10);
	}
	setInterval(function() {
		p = mraid.getCurrentPosition(), s = mraid.getScreenSize(), d = document.getElementById('pc'), y = (1-(s.height-p.y)/s.height)*300;
		d && (d.scrollTop = y);
	}, 10);
}
</script>

<style type="text/css">
#pc { position: relative; width: 300px; height: 300px; overflow: hidden; }
</style>

<div id="pc">
	<a href="https://www.reddit.com/r/cats/"><img src="http://placekitten.com/300/600" width="300" height="600"></img></a>
</div>

Related Topics