我正在使用tooltipster,並有一個工具提示,顯示何時單擊菜單按鈕(此位工作正常)。 我在使用工具提示中的關閉按鈕關閉工具提示時遇到了問題。工具提示關閉按鈕
我必須錯過一些非常簡單的事情。
HTML
<span class="tooltip-email-share"> Stuff </span>
<!-- is triggered by this link -->
<ul>
<...>
<li><a class="menu-share"></a></li>
<...>
</ul>
HTML工具提示(以防萬一)
<div class="tt-email-share">
<span class="tt-close"></span>
<h1>Title</h1>
<form>
</form>
</div>
JS
// initiates the tooltip - trigger set to custom & autoClose is false, so it wont close without pressing the close button.
$('.tooltip-email-share').tooltipster({
theme: 'tooltipster-html-shadow',
interactive: 'true',
autoClose: 'false',
position: 'bottom',
speed: '200',
trigger: 'custom',
content: $('HTML Stuff in here')
});
// Shows the tooltip (this bit works a charm)
$('.menu-share').click(function(){
$('.tooltip-email-share').tooltipster('show');
});
// *should* close the tooltip (doesn't work)
$('.tt-close').click(function(){
$('.tooltip-email-share').tooltipster('hide');
});
我發現如果代碼附加到工具提示之外的按鈕上,它會關閉。不知道該怎麼做在這一點.. – Sarah 2014-09-22 21:27:16
我還沒有嘗試過這個插件,但發現這關閉工具提示。希望能幫助到你。 $( '提示,電子郵件股 ')的數據(' plugin_tooltipster')hideTooltip()。 – DinoMyte 2014-09-22 21:47:39
沒有骰子不幸的是,謝謝你的提示! – Sarah 2014-09-22 22:00:06