Skip to content

Commit 18c7a79

Browse files
authored
tooltip ajax example
1 parent 62e5ad6 commit 18c7a79

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

entries/tooltip.xml

+23
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,29 @@
156156
<p>
157157
<a href="#" title="Anchor description">Anchor text</a>
158158
<input title="Input help">
159+
</p>]]></html>
160+
</example>
161+
<example>
162+
<height>100</height>
163+
<desc>Create an ajax tooltip</desc>
164+
<code><![CDATA[
165+
$(document).tooltip({
166+
content: function(setContent){
167+
var element = $( this );
168+
$.get("somefile.txt")
169+
.then( text => {
170+
setContent(text);
171+
})
172+
.catch ( (e) => {
173+
setContent(`${e.statusText}`);
174+
})
175+
},
176+
items: "a, [href]",
177+
});
178+
]]></code>
179+
<html><![CDATA[
180+
<p>
181+
<a href="#" title="Anchor description">Anchor text</a>
159182
</p>]]></html>
160183
</example>
161184
<category slug="widgets"/>

0 commit comments

Comments
 (0)