I'm trying to upload a mraid project to Google's DoubleClick studio and notice the mraid.expand() event is not working properly. The ad is meant to be an in-app expandable banner, and basically after the very first time, mraid.expand() will not actually expand to full screen but rather expand to within the banner itself. The solution right now is this:
var isFirstTime = true;
...
if(isFirstTime) {
mraid.expand();
isFirstTime = false;
} else {
mraid.expand();
if (window.parent) window.parent.mraid.expand();
}
I noticed that because DoubleClick embeds everything into layers of , the closing button is actually in the parent of the containing the code we uploaded, thus a window.parent.mraid.expand() is needed to trigger the expand() properly. This seem really hacky, and I'm wondering if anyone has seen this issue before or has a better solution.
Keep in mind that MRAID format was deprecated from DoubleCLick Studio, it is required to build Mobile-friendly Studio HTML5 format instead.