Bootstrap Datepicker在日期显示popover

时间:2016-09-23 15:17:31

标签: javascript twitter-bootstrap datepicker popover

当用户点击输入字段时,我已成功添加了bootstrap datepicker。我想在鼠标悬停在bootstrap datepicker上时显示一些具体数据,因为它可能是airbnb吗?

enter image description here

编辑

Here is my fiddle

HTML

DETAIL: Array value must start with "{" or dimension information.

JS

  <input type="text" name="start_date" id="date-from" placeholder="Check-in"> 

1 个答案:

答案 0 :(得分:3)

这是我更新的JSFiddle以显示popover。

https://jsfiddle.net/mr3dxj5p/4/

$('body').on({
    mouseenter: function() {
      $(this).popover({
        content: '$' + parseInt($(this).text()) * 100,
        placement: 'top',
        container: '.datepicker',
        title: 'Price'
      }).popover('show');
    },
    mouseleave: function() {
      $(this).popover('hide')
    }
  }, '.datepicker .day:not(.disabled)');