0
我嘗試使用popover https://github.com/sandywalker/webui-popover。我需要'quora'彈出窗口功能:鏈接應該是可點擊的,但懸停應該顯示帶有加載內容的Ajax的彈出窗口。如何使用懸停和ajax內容的webui-popover
我試過如下:
$(function(){
function details_in_popup(link, div_id){
$.ajax({
url: link,
success: function(response){
$('#'+div_id).html(response);
}
});
return '<div id="'+ div_id +'">Loading...</div>';
}
$('a.user_popover').livequery(function(){
var link = 'your_url_there';
$(this).webuiPopover({
content: function(data){
var div_id = "tmp-id-" + $.now();
return details_in_popup(link, div_id);
},
placement: 'bottom',
trigger: 'hover',
cache: false
});
})
})
確切位置在哪裏,你有麻煩? – Anton
這是不可能使用'懸停'事件與Ajax加載內容。如果我使用「網址」的「異步」類型,彈出只能通過點擊觸發。 –