モールアシストで作成したiframeの高さを自動で調整したい場合は、
以下のjavascriptを、iframeを呼び出している親ページに埋め込んでください。
(要jQuery、楽天GOLD及びYahoo!トリプルのスペースで有効)
jQuery(function($) {
function JSON_parse( arg ) {
if( typeof arg !== 'string' ) return false;
try {
return (!JSON) ? eval('(' + arg + ')') : JSON.parse(arg);
} catch (e) {
return false;
}
};
$(window).on('message', function(e) {
var json = JSON_parse( e.originalEvent.data );
if( ! json || ! json.id || ! json.height ) return false;
$('iframe').each(function(i) {
var $this = $(this);
var src = $this.attr('src');
if( ! src ) src = $this.data('src');
if( src.match(new RegExp('#!id=' + json.id + '$')) ) $this.height( json.height );
if( src.match(new RegExp('index_' + json.id + '.html')) ) $this.height( json.height );
});
});
});