私のページのセクションにjQuery AJAXコールをロードしていて、そのセクション内でqTipsを使用したいとします。通常、AJAXを使用してjQuery関数をロードするときは、.live()
関数を使用します。 .live()
を使ってqTipを添付する方法はありますか?それともqTipに相当するのですか?qtip live()support
私は、qTip 2.0にこのサポートがあると聞いてきましたが、2.0はまだ準備ができていないと思います。
解決方法はありますか?
以下私は動作するはずと信じて、完全なコードですが、いないように:
$('.editquestion').live('click', function() {
$(this).qtip({
overwrite:false,
content: {
url: $(this).attr('href'),
data: { id: 5 },
method: 'get',
title: {
text: 'Edit Question',
button: 'Close'
},
cache: false,
},
position: {
target: $(document.body), // Position it via the document body...
corner: 'center' // ...at the center of the viewport
},
show: {
ready:true,
},
hide: false,
style: {
width: {
max: 550,
min: 550
},
height: {
max: 300,
min:300
},
padding: '14px',
border: {
width: 9,
radius: 9,
color: '#666666'
},
name: 'light'
},
api: {
beforeShow: function() {
// Fade in the modal "blanket" using the defined show speed
$('#qtip-blanket').fadeIn(this.options.show.effect.length);
},
beforeHide: function() {
// Fade out the modal "blanket" using the defined hide speed
$('#qtip-blanket').fadeOut(this.options.hide.effect.length);
}
}
});
return false;
});
編集:たぶん私もQティップがフォームをロードするために、AJAXを使用していることを言及する必要があります。
ええと、ありがとう。最初のリンクは私が見たリンクです。それは私には意味があり、論理的にはうまくいくはずだが、そう思わない。まるで自分自身のコピーを作成しているかのように振る舞います。 qTipを呼び出すたびに、より多くの通話が行われます(たとえば、1回目、2回目、2回目など)。第二のリンクは私にはあまり意味がありません。静的なページにqtipsを付けるのはそれほど普通の方法ではありませんか? – emachine