asp.netページにjQueryqtip()関数があり、クリックしたアイテムからIDを取得する必要があります。誰かがそれを行う方法を知っていますか?
例として、私のスクリプトコードの下を見つけてください...
$("#content a.toolTip").qtip({
content: { url: 'PageView.aspx?Param=' + '---get id---' }
)};
前もって感謝します。
[]'rpg
this
qtipを設定するときにを介して要素を参照する場合は、の内部で設定を行うことができます.each()
。その方法this
は、現在の要素を参照します。
$("#content a.toolTip").each(function() {
// Now "this" is a reference to the
// element getting the qtip
// Get the ID attribte -------------------------------v
$(this).qtip({ content: { url: 'PageView.aspx?Param=' + this.id } });
});
$( "#content a.toolTip")。qtip({
コンテンツ:{url:'PageView.aspx?Param ='+ $(this).attr('id')}
)};
いくつかのパラメータを取得する必要がある場合は、このようにごまかすことができます;)
$("#content a.toolTip").each(function()
{
$(this).qtip({
content: { url: 'PageView.aspx?Param=' + $(this).attr('id') }
});
});