jqueryを使用して、ajaxを介していくつかのhtmlをdivにロードしています。コンテンツがロードされたら、DD_belatedPNG を使用して ie6 用の png を修正する必要があります。以下のコード -
$("#content").fadeOut(function(){
$(this).html("<div><p>some text</p><img src='myimage.png' class='dayPosted' /><p>some more text</p></div>").fadeIn( fixIeIssue() ); //The html in this function is for example only, in my app it's populated by ajax.
})
fixIeIssue = function(){
if (window.DD_belatedPNG){
//alert("for some reason this works if I call an alert here")
DD_belatedPNG.fix('.dayPosted');
}
}
png 修正が機能していません。奇妙なことに、修正を呼び出す前にアラートを呼び出すと機能します。
document.ready を fixIeIssue に追加しようとしましたが、役に立ちませんでした。
png 修正は、最初のページ読み込みで機能します。