誰かが私がこれを解決するのを手伝ってくれませんか。
jqueryを使用してブラウザウィンドウに合うようにフラッシュオブジェクト/埋め込みコードのサイズを変更しています。以下のHTMLを参照してください。
HTML
<div id="prezi">
<object id="prezi_3453246342644353463435463456435" width="1000" height="800">
<embed width="1000" height="800" ></embed>
</object>
</div>
JQUERY(THIS WORKS)
function preziresize() {
var $objectId = $('#prezi_3453246342644353463435463456435'),
$objectEmbed = $objectId.find('embed'),
windowWidth = $(window).width(),
windowHeight = $(window).height();
$objectId.attr( 'height' , windowHeight ).attr( 'width' , windowWidth );
$objectEmbed.attr( 'height' , windowHeight ).attr( 'width' , windowWidth );
}
$(document).ready(function() {
preziresize();
});
$(window).resize(function() {
preziresize();
});
私の問題
ただし、上記のスクリプトの欠点は、オブジェクトのIDを手動でスクリプトに入力する必要があることです。:(
動作していない新しいスクリプトで、オブジェクトのIDを自動的に取得し、それを変数として割り当てようとしています。以下の私の機能をご覧ください。
function preziresize() {
var $objectId = $('#prezi').attr( 'id' ),
$objectEmbed = $objectId.find('embed'),
windowWidth = $(window).width(),
windowHeight = $(window).height();
$objectId.attr( 'height' , windowHeight ).attr( 'width' , windowWidth );
$objectEmbed.attr( 'height' , windowHeight ).attr( 'width' , windowWidth );
}
どんなポインタでも大いに感謝します。
ジョシュ