因此,這裏是/使用 這裏的一些例子,我做的是對CSS:
<style>
.popover-title{
background: #428bca;
color: #ffffff;
}
</style>
下面是HTML:
<a rel="popover" id="test" data-color="yellow" title="My Title" data-placement="top"
data-content="Say something!" >
這將是JavaScript的:
$(document).ready(function() {
setTimeout(function(){$('#test').popover('show');},5000);
setTimeout(function(){$('#test').popover('hide');},15000);
$('body').click(function(e) {
$('#test').popover('hide');
});
$('#test2').hover(function(){
if ($("#popoverTrigger").next('div.popover:visible').length){
$('#test').popover('hide');
}else{
timer1 = setTimeout(function(){$('#test').popover('show');},900);
timer2 = setTimeout(function(){$('#test').popover('hide');},4800);
}
},
function(){clearTimeout(timer1); clearTimeout(timer2); $('#test').popover('hide');
});
});
這裏發生的事情是在我的一個divs中的某個位置出現popover。然後它在5秒後出現。 15秒後消失。如果點擊在網頁上註冊,它也會消失。還有一個懸停方法
來源
2014-08-27 20:55:35
Jay
所以你想提出工具提示或popover? :) – Kamil 2014-08-27 20:55:22
對不起,一個popover,謝謝 – 2014-08-27 20:59:39