0

プラグインを介してページの背景として表示される画像があり、ページの他の場所にある DIV 内にその画像の ALT テキストを表示しようとしています。

登場するコードは次のとおりです。

<!-- Background Manager Start -->
<div id="myatu_bgm_img_group" class="myatu_bgm_fs" style="overflow: hidden;"><script type="text/javascript">
    /*<![CDATA[*/
        try{(function(a){myatu_bgm.addTopImage("",function(){if((typeof myatu_bgm!=="undefined")&&(myatu_bgm.initial_ease_in==="true")){a(this).fadeIn("slow")}else{a(this).show()}})}(jQuery))}catch(e){};
    /*]]>*/
    </script><noscript><img id="myatu_bgm_top" class="myatu_bgm_fs" src="http://mgrezova.webfactional.com/wp-content/uploads/2013/06/agnesbshirt.jpg" alt="Caption Text"   /></noscript></div>
<!-- Background Manager End -->

次のDIV内にその「キャプションテキスト」を出力できるJavaScriptまたは何か他のものを誰かが提案できますか?

<DIV class="quote">
    <DIV class="inner-quote">
    </DIV>
</DIV>

どんな助けでも大歓迎です。

4

2 に答える 2

2

これを試して:

$('.inner-quote').html($('#myatu_bgm_top').prop('alt'));
于 2013-09-09T11:12:44.277 に答える