sizeChange can not listen the resize event change correctly

58 views
Skip to first unread message

carrot...@gmail.com

unread,
Apr 16, 2014, 9:43:21 PM4/16/14
to ormma-di...@googlegroups.com
as a ad html5 dev,
function resizeAd() {
alert("resizeAd");
if( typeof(mraid) != 'undefined' ) {mraid.resize(300, 300);}
}
after calling resizeAd(),and fire sizeChange event,
mraid.addEventListener('sizeChange', handleSizeChangeEvent);
function handleSizeChangeEvent(width, height){
alert("w??="+width+", h??="+height);
}
alert result is:w??=450,h??=450;not the settled one just resized (300,300)
Is that sdk dev bug or other reason that result in this diff??

Nathan Carver

unread,
Apr 17, 2014, 9:34:00 AM4/17/14
to ormma-di...@googlegroups.com
The resize method does not take any parameters. Normally you set the resize properties before calling resize. So I would suggest a change to something like.

mraid.addEventListener('error', myErrorEvent);

var props = mraid.getResizeProperties();
props.width = 300;
props.height = 300;

mraid.setResizeProperties(props);
mraid.resize();

Thanks,
-Nathan



--
You received this message because you are subscribed to the Google Groups "ORMMA-discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ormma-discussi...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

carrot...@gmail.com

unread,
Apr 18, 2014, 12:50:16 AM4/18/14
to ormma-di...@googlegroups.com
use the setResizeProperties() to set the resize property(300x300),
and fire sizeChange event,
mraid.addEventListener('sizeChange', handleSizeChangeEvent);
function handleSizeChangeEvent(width, height){
alert("w??="+width+", h??="+height);
}
alert result is:w??=450,h??=450;not the settled one just resized (300,300),what is the matter with this??

Nathan Carver

unread,
Apr 18, 2014, 9:24:33 AM4/18/14
to ormma-di...@googlegroups.com
What are the values from getResizeProperties? And what are the values from the window object? If these are not what you expect, then you may need to reach out to the SDK vendor.

Thanks,
-Nathan

Reply all
Reply to author
Forward
0 new messages