data-original-title或者title的值如何調(diào)用函數(shù)?
?下面這種寫(xiě)法哪里出錯(cuò)了?為什么出不來(lái)效果?
<button type="button"
? ? ? ? ? class="btn btn-default"
? ? ? ? ? data-toggle="popover"
? ? ? ? ? title=showContent()
? ? ? ? ? data-content="我是彈出框的內(nèi)容"
? ? ? ? ? data-trigger="hover focus">
? ? ? ? ? 猛擊我吧
? </button>
<script>
$(function(){
? $('[data-toggle="popover"]').popover();
});
function showContent(){
? ? return "我是通過(guò)函數(shù)返回的彈出框內(nèi)容";
}
</script>
2017-05-11
給你點(diǎn)提示,用each試試看
2016-09-09
沒(méi)辦法調(diào)用,只有寫(xiě)click等事件的時(shí)候才會(huì)作用