Versions Compared


  • 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.


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

function onSDKReady() {
	if ((typeof window.anjam.SetMRAIDRefreshFrequency) !== "undefined") {
	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);

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

<div id="pc">
	<a href=""><img src="" width="300" height="600"></img></a>

Related Topics