1

私は、単純に div をポップアップして画面をブラックアウトする単純なポップアップ プラグインを作成しました。それは2つの方法で機能します。シンプルなメッセージと ajax による読み込み。ここに私の問題があります

私はこのような世論調査のリストを持っています:

<div id="pollList" style=" margin-top:10px;">
<li pollId='1'><strong>polling number 1</strong></a><br /><span style='font-size:9px;'>this is a test polling</span></li>
<li pollId='2'><strong>polling number 2</strong></a><br /><span style='font-size:9px;'>this is a test polling</span></li>

今、私は自分のプラグインをこのすべてのliタグに適用したいので、これを使用しました:

$("#pollList li").popup({
    width:800,
    height:400,
    popupType:'ajax',
    ajaxURL:root+'polls/attend/poll/'+$(this).attr('pollId')
 });

関連する URL を呼び出すために $(this).attr('pollId') をプラグインに渡したい問題がありますが、$(this) は機能せず、'undefined' を返すようです。プラグインのオプション?

4

1 に答える 1