markdown BS Popover与JS

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown BS Popover与JS相关的知识,希望对你有一定的参考价值。

### Bootstrap
* Add a `rel` to an `<a>` tag: `<a rel="popover"`
* Along with a `data-img` attribute: `<a rel="popover" data-img="contains the link to the image"`

---

### JQUERY
* Add the following jQuery to the selected anchor elements:

```javascript
$(function() {
  $('a[rel=popover]').popover ({
    html: true,
    trigger: 'hover', //View the image on hover
    placement: 'right', //Where should the popover occur
    content: function() {
      return '<img src="' + $(this).data('img') + '" />'; //how the image is shown
    }
  })
})
```

---

### CSS
* If the image is larger than the popver container, add the following in your css file:
` .popover {max-width: 100%; }`

---

### Resources
* [link1](http://embed.plnkr.co/nhlFPz//placehold.it/400x200)

以上是关于markdown BS Popover与JS的主要内容,如果未能解决你的问题,请参考以下文章

boostrap之弹出框(popover),控制只有一个只显示框

检测 uib-popover 何时打开和关闭?

带有 farbtastic 颜色选择器内容的 Twitter Bootstrap Popover.js 丢失了附加的事件

markdown BS表格

markdown 以BS为中心

markdown 等BS柱高度