2014-09-06 40 views
0

我想使用AngularStrap彈出來從文本元素中觸發彈出。 是否可以通過錨點觸發彈出窗口?還是一個跨度元素或這樣的?錨點上的AngularStrap彈出

這工作:

<button content="hello" trigger="focus" bs-popover>clickme</button> 

但這並不:

<a href="" content="hello" trigger="focus" bs-popover>clickme</a> 
<span href="" content="hello" trigger="focus" bs-popover>clickme</span> 
<label href="" content="hello" trigger="focus" bs-popover>clickme</label> 
<small href="" content="hello" trigger="focus" bs-popover>clickme</small> 

我無法找到如何做一個例子,這是一個錨 - 既不是否有可能或不。 (span元素任何其他lablelike元素也會去,但沒有按鈕.....) 似乎是一個非常愚蠢的問題給我,但我實在找不到一個合適的答案:/

非常感謝!

+0

沒有人知道嗎?或者這真的太簡單了,我只是盲目得到它? :/ – BAER 2014-09-07 08:26:20

回答

1

問題是trigger='focus'適用於可重點元素;按鈕是可以調焦的,錨和跨度不是。嘗試trigger='hover',或trigger='click' 您可以檢查我的plunker: http://plnkr.co/edit/4oi1ucgQa6zqhQSlVhzu

+0

聽起來很有希望,我會在家時測試它。但我記得有些事情沒有用'點擊'工作,我會看到... – BAER 2014-09-08 07:50:07

+0

工程,不知道爲什麼我沒有這樣試過。我想當時我想要得到的焦點效果是:點擊它(出現),點擊其他地方,它消失。我現在不想要了,所以點擊適合我。 但出於好奇:如果我想要上述行爲,我該怎麼做?由於trigger =「focus」不起作用?我是否需要自己實施它,當我點擊其他地方時,它會消失? – BAER 2014-09-08 15:50:47

0

嘗試設置選項卡索引你的錨標記,像這樣:

<a tabindex="0" href="" content="hello" trigger="focus" bs-popover>clickme</a> 

this discussion和點擊的this analysis /聚焦的錨標記上的不同瀏覽器。