Bootstrap popover 實現(xiàn)鼠標移入移除顯示隱藏功能方法
更新時間:2018年01月24日 11:40:22 作者:田小濤
下面小編就為大家分享一篇Bootstrap popover 實現(xiàn)鼠標移入移除顯示隱藏功能方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
該段js代碼可實現(xiàn) popover 下鼠標移入移除時顯示、隱藏 popover 提示信息功能
var strContent = '<div class="media"><div class="position-left media-left"><img class="img-circle" src="/assets/images/avatar.jpg">'+
'</div>'+
'<div class="media-body">'+
'<h4 class="media-title">小標題</h4>'+
'<p><strong>張三</strong> <span class="label label-primary">管理員</span></p>'+
'</div>'+
'</div>';
$( 'li#user_avatar' ).popover({
trigger:'manual',
placement:'bottom',
html:true,
container:'#bs-example-navbar-collapse-1',
content:strContent,
}).on( 'mouseenter', function(){
var _this = this;
$(this).popover( 'show' );
$(this).siblings( '.popover' ).on( 'mouseleave' , function () {
$(_this).popover( 'hide' );
});
}).on( 'mouseleave', function(){
var _this = this;
setTimeout(function () {
if (!$( '.popover:hover' ).length) {
$(_this).popover( 'hide' )
}
}, 100);
});
以上這篇Bootstrap popover 實現(xiàn)鼠標移入移除顯示隱藏功能方法就是小編分享給大家的全部內(nèi)容了,希望能給大家一個參考,也希望大家多多支持腳本之家。
相關文章
javascript中call,apply,bind函數(shù)用法示例
這篇文章主要介紹了javascript中call,apply,bind函數(shù)用法,結合實例形式分析了call,apply,bind函數(shù)的功能、使用方法與相關注意事項,需要的朋友可以參考下2016-12-12
js實現(xiàn)將選中內(nèi)容分享到新浪或騰訊微博
這篇文章主要介紹了js實現(xiàn)將選中內(nèi)容分享到新浪或騰訊微博,需要的朋友可以參考下2015-12-12
filters.revealTrans.Transition使用方法小結
有看到幻燈片調(diào)用會用到divid.filters.revealTrans.Transition=Math.floor(Math.random()*23)和divid.filters.revealTrans.apply(),那么這兩個都是什么意思呢?2010-08-08
Javascript仿PHP $_GET獲取URL中的參數(shù)
這篇文章主要介紹了Javascript仿PHP $_GET獲取URL中的參數(shù)代碼實例,需要的朋友可以參考下2014-05-05

