How can I hold Twitter Bootstrap Popover open until my mouse moves into it?

前端 未结 16 1385
野性不改
野性不改 2020-12-04 05:55

I have a link that uses the Twitter Bootstrap Popover version 1.3.0 to show some information. This information includes a link, but every-time I move my mouse from the link

16条回答
  •  -上瘾入骨i
    2020-12-04 06:45

    Just to add to Marchello's example, if you want the popover to disappear if the user moves their mouse away from the popover and source link, try this out.

    var timeoutObj;
    $('.nav_item a').popover({
        offset: 10,
        trigger: 'manual',
        html: true,
        placement: 'right',
        template: '

    ' }).mouseenter(function(e) { $(this).popover('show'); }).mouseleave(function(e) { var ref = $(this); timeoutObj = setTimeout(function(){ ref.popover('hide'); }, 50); });

提交回复
热议问题