I\'m trying to change the width of my ad image from pixels to percentages. I\'m using Google DoubleClick or \"DFP\". It automatically puts your ad image inside an iframe, makin
Here is a jsfiddle with an example of what I am pretty sure you want to do... so yes it is possible... whether it violates the terms of DFP is another question!
http://jsfiddle.net/e3dUT/ (resize the panes to see it working, only working 100% in chrome at the moment, but that should just be a matter of tweaking it some more.)
$.dfp({
dfpID: '12589173',
afterAllAdsLoaded: function ($adUnits) {
$('iframe').attr('width', '100%').attr('height', '100%');
$adUnits.each(function () {
$contents = $(this).find('iframe:first').contents();
$contents.find('img').width('100%').height('auto');
});
}
});
It uses the jQuery DFP plugin I created, but with a bit of work you could implement this in stock javascript as well.