demo.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <meta http-equiv="Content-type" content="text/html;charset=UTF-8" />
  6. <title>jQuery.popover demo page</title>
  7. <link rel="stylesheet" href="_page.css" type="text/css" media="screen" />
  8. <link rel="stylesheet" href="popover.css" type="text/css" media="screen" />
  9. <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  10. <script type="text/javascript" src="jquery.popover-1.1.2.js"></script>
  11. <script type="text/javascript">
  12. /* <![CDATA[ */
  13. jQuery(document).ready(function($) {
  14. $("#ex1").popover({
  15. trigger: 'click'
  16. });
  17. $("#ex2").popover({
  18. title: "Hello",
  19. content: "Finally, I can speak!"
  20. });
  21. $("#ex3a").popover({
  22. title: "<_<",
  23. content: "Damn.",
  24. trigger: 'none'
  25. });
  26. $("#ex3b").click(function(event) {
  27. event.preventDefault();
  28. event.stopPropagation();
  29. $("#ex3a").popover('show');
  30. });
  31. $("#bubble_expl").popover({
  32. title: "Bubble up",
  33. content: "When you click a link on a web page, not only do you click that link, you also click it's parent. You clicked this linked, but also it's parent &lt;p&gt;-tag, and it's parent the &lt;body&gt;-tag and, it's parent the &lt;html&gt;-tag. The popover('hide') event is bound to the &lt;html&gt;-element, so this will trigger as well, causing the popover to fade out immediately. By using the stopPropagation() method we prevent this.",
  34. classes: 'large'
  35. });
  36. $("#ex4a").popover({
  37. title: "Guess what this is...",
  38. content: "Pa's wijze lynx bezag vroom het fikse aquaduct.",
  39. trigger: 'none'
  40. });
  41. $("#ex4b").click(function(event) {
  42. event.preventDefault();
  43. event.stopPropagation();
  44. $("#ex4a").popover('show');
  45. });
  46. $("#ex4c").click(function(event) {
  47. event.preventDefault();
  48. event.stopPropagation();
  49. $("#ex4a").popover('hide');
  50. });
  51. $("#ex4d").click(function(event) {
  52. event.preventDefault();
  53. event.stopPropagation();
  54. $("#ex4a").popover('fadeOut');
  55. });
  56. $("#ex4e").click(function(event) {
  57. event.preventDefault();
  58. event.stopPropagation();
  59. $("#ex4a")
  60. .popover('destroy')
  61. .text("Nooo! What have you done?!");
  62. });
  63. $("#ex5a").popover({
  64. title: "Hmm...",
  65. content: "And programming is your friendship!"
  66. });
  67. $("#ex5b, #ex5c").click(function(event) {
  68. event.preventDefault();
  69. event.stopPropagation();
  70. $("#ex5a").popover(
  71. 'title',
  72. $(this).text()+" is your friend"
  73. ).popover('show');
  74. });
  75. $("#ex6a").popover({
  76. title: "Dynamic content",
  77. content: "At least a popover that makes some sense..."
  78. });
  79. $("#ex6b").click(function(event) {
  80. event.preventDefault();
  81. event.stopPropagation();
  82. $("#ex6a").popover(
  83. 'content',
  84. "At least a popover that makes some sense... Don't get used to it."
  85. ).popover('show');
  86. });
  87. $("#ex7a").popover({
  88. title: "What's this",
  89. content: "...",
  90. classes: "wider"
  91. });
  92. $("#ex7b").click(function(event) {
  93. event.preventDefault();
  94. event.stopPropagation();
  95. $("#ex7a").popover(
  96. 'ajax',
  97. "ajax.html"
  98. ).popover('title', "It's AJAX content!").popover('show');
  99. });
  100. /**
  101. * Collapse code blocks
  102. */
  103. var code_min_height = 150;
  104. $('pre').each(function() {
  105. $this = $(this);
  106. var org_height = $this.height();
  107. var toggld = false;
  108. if(org_height > code_min_height)
  109. $this.height(code_min_height);
  110. $this.bind('click', function() {
  111. $this = $(this);
  112. if(toggld) {
  113. $this.stop(true, true).animate({ height: code_min_height });
  114. toggld = false;
  115. } else {
  116. $this.stop(true, true).animate({ height: org_height });
  117. toggld = true;
  118. }
  119. })
  120. });
  121. /**
  122. * Table of contents
  123. */
  124. toc_paragraph = function(p) {
  125. var ret = $('<li><a href="'+p.href+'">'+p.title+'</a></li>');
  126. $.each(p.items, function(i, val) {
  127. if(ret.children('ul').length === 0)
  128. ret.append('<ul />');
  129. ret.children('ul').append(toc_paragraph(val));
  130. });
  131. return ret;
  132. }
  133. generate_toc = function() {
  134. var toc = {};
  135. var toc_el = $('#table_of_contents');
  136. $('a[name]').each(function() {
  137. $this = $(this);
  138. var item = {};
  139. var name = $this.attr('name');
  140. var href = "#" + name;
  141. var title = $this.attr('title');
  142. if(typeof title === "undefined")
  143. title = $this.next().text();
  144. item.href = href;
  145. item.title = title;
  146. item.items = {};
  147. var split = $this.attr('name').split('_');
  148. if(split.length > 1)
  149. toc[split[0]].items[name] = item;
  150. else
  151. toc[name] = item;
  152. });
  153. toc_el.empty();
  154. $.each(toc, function(i, val) {
  155. toc_el.append(toc_paragraph(val));
  156. });
  157. }
  158. generate_toc();
  159. });
  160. /* ]]> */
  161. </script>
  162. </head>
  163. <body>
  164. <h1>jQuery.popover</h1>
  165. <p>Easy to use and customizable popover plugin for jQuery.</p>
  166. <p>Take a look at <a href="http://wp.me/p12l3P-gT">this blog post</a> for more details.</p>
  167. <a name="toc"></a>
  168. <h2>Table of Contents</h2>
  169. <ul id="table_of_contents"></ul>
  170. <a name="usage"></a>
  171. <h2>Usage</h2>
  172. <a name="usage_initialization"></a>
  173. <h3>Initialization</h3>
  174. <p>With default settings, calling $(element).popover(); will initalize an empty popover on the element.</p>
  175. <div class="sandbox">
  176. <a href="#" id="ex1">I have a popover, but you can't see me. Yet.</a>
  177. </div>
  178. <p>When you click the link above, the popover is shown. This is achieved by using <code>{ trigger: 'click' }</code> in the parameters. <em>You can hide the popover by clicking anywhere there's not a popover.</em> The source code for the above example is:</p>
  179. <pre><code>$("#ex1").popover({
  180. trigger: 'click'
  181. });</code></pre>
  182. <p>When this code was executed, the popover was created but not shown. A <code>click</code> event was bound to the <code>a</code>-tag with which the popover is &#147;connected&#148;. When that element is clicked, the popover is shown.
  183. <p>But hows an empty popover any fun? Let's try this:</p>
  184. <div class="sandbox">
  185. <a href="#" id="ex2">Please, let me speak!</a>
  186. </div>
  187. <p>Now we've put some content in our popover using the parameters <code>{ title: &quot;Hello&quot;, content: &quot;Finally, I can speak!&quot; }</code>, like so:</p>
  188. <pre><code>$(&quot;#ex2&quot;).popover({
  189. title: &quot;Hello&quot;,
  190. content: &quot;Finally, I can speak!&quot;
  191. });</code></pre>
  192. <p>Note that I've ommited <code>{ trigger: 'click' }</code> in this example. It's the default setting for popovers.</p>
  193. <a name="usage_manual"></a>
  194. <h3>Pulling the trigger manually</h3>
  195. <p>You can show, hide and fade out an initialized popover manually by calling <code>popover('show')</code>, <code>popover('hide')</code> and <code>popover('fadeOut')</code> on the element the popover was initialized over.</p>
  196. <div class="sandbox">
  197. <span id="ex3a">Nope, can't be triggered, bro.</span>
  198. <a href="#" id="ex3b">Oh yes you can!</a>
  199. </div>
  200. <p>The code for this example is as follows. <em>Click a code box to expand it.</em></p>
  201. <pre><code>$(&quot;#ex3a&quot;).popover({
  202. title: &quot;&amp;lt;_&amp;lt;&quot;,
  203. content: &quot;Damn.&quot;,
  204. trigger: 'none'
  205. });
  206. $(&quot;#ex3b&quot;).click(function(event) {
  207. event.preventDefault();
  208. event.stopPropagation();
  209. $(&quot;#ex3a&quot;).popover('show');
  210. });</code></pre>
  211. <p>You must must call <code>event.preventDefault()</code> and <code>event. stopPropagation()</code> on the triggeree (?) / element that triggers the popover, otherwise <code>click</code>-event will <a href="#" id="bubble_expl">bubble up</a> to the document and the popover will immediately be hidden.</p>
  212. <p>You can call <code>popover('fadeOut')</code> and <code>popover('hide')</code> to hide popovers with and without a fade animation.</p>
  213. <a name="usage_hiding"></a>
  214. <h3>Hide and destroy</h3>
  215. <p>Use <code>popover('hide')</code>, <code>popover('fadeOut')</code> and <code>popover('destory')</code> to hide, fade out and destroy popovers. Call these methods on the element where the popover was initialized over.</p>
  216. <div class="sandbox">
  217. <span id="ex4a">I have a popover.</span><br />
  218. <a href="#" id="ex4b">Show</a> | <a href="#" id="ex4c">Hide</a> | <a href="#" id="ex4d">Fade out</a> | <a href="#" id="ex4e">Destroy</a>
  219. </div>
  220. <p>These methods can be seen as the <abbr title="Application Programming Interface">API</abbr> for jQuery.popover. Here the code for this example:</p>
  221. <pre><code>$(&quot;#ex4a&quot;).popover({
  222. title: &quot;Guess what this is...&quot;,
  223. content: &quot;Pa's wijze lynx bezag vroom het fikse aquaduct.&quot;,
  224. trigger: 'none'
  225. });
  226. $(&quot;#ex4b&quot;).click(function(event) {
  227. event.preventDefault();
  228. event.stopPropagation();
  229. $(&quot;#ex4a&quot;).popover('show');
  230. });
  231. $(&quot;#ex4c&quot;).click(function(event) {
  232. event.preventDefault();
  233. event.stopPropagation();
  234. $(&quot;#ex4a&quot;).popover('hide');
  235. });
  236. $(&quot;#ex4d&quot;).click(function(event) {
  237. event.preventDefault();
  238. event.stopPropagation();
  239. $(&quot;#ex4a&quot;).popover('fadeOut');
  240. });
  241. $(&quot;#ex4e&quot;).click(function(event) {
  242. event.preventDefault();
  243. event.stopPropagation();
  244. $(&quot;#ex4a&quot;)
  245. .popover('destroy')
  246. .text(&quot;Nooo! What have you done?!&quot;);
  247. });</code></pre>
  248. <p>It could probably be a bit shorter, but I'll let you figure that out.</p>
  249. <a name="usage_modifying"></a>
  250. <h3>Modifying on the fly</h3>
  251. <a name="usage_modifying_title"></a>
  252. <h4>Title</h4>
  253. <p>You can change the title on the fly with by using <code>popover('title', "Text")</code>.</p>
  254. <div class="sandbox">
  255. <span id="ex5a">PHP or Ruby?</span>
  256. <a href="#" id="ex5b">PHP</a> | <a href="#" id="ex5c">Ruby</a>
  257. </div>
  258. <pre><code>$("#ex5a").popover({
  259. title: "Hmm...",
  260. });
  261. $("#ex5b, #ex5c").click(function(event) {
  262. event.preventDefault();
  263. event.stopPropagation();
  264. $("#ex5a").popover(
  265. 'title',
  266. $(this).text()+" is your friend"
  267. ).popover('show');
  268. });</code></pre>
  269. <a name="usage_modifying_content"></a>
  270. <h4>Content</h4>
  271. <p>You can change the title on the fly with by using <code>popover('content', "Text")</code>.</p>
  272. <div class="sandbox">
  273. <span id="ex6a">Click here first | </span>
  274. <a href="#" id="ex6b">change content</a>
  275. </div>
  276. <pre><code>$(&quot;#ex6a&quot;).popover({
  277. title: &quot;Dynamic content&quot;,
  278. content: &quot;At least a popover that makes some sense...&quot;
  279. });
  280. $(&quot;#ex6b&quot;).click(function(event) {
  281. event.preventDefault();
  282. event.stopPropagation();
  283. $(&quot;#ex6a&quot;).popover(
  284. 'content',
  285. &quot;At least a popover that makes some sense... Don't get used to it.&quot;
  286. ).popover('show');
  287. });</code></pre>
  288. <a name="usage_modifying_ajax"></a>
  289. <h4>Loading AJAX content</h4>
  290. <p>You can load a webpage as content via AJAX by using <code>popover('ajax', "http://example.com/" [, options])</code>.</p>
  291. <div class="sandbox">
  292. <span id="ex7a">Click here first | </span>
  293. <a href="#" id="ex7b">load ajax content</a>
  294. </div>
  295. <p>Please note this only works when running on a webserver.</p>
  296. <pre><code>$(&quot;#ex7a&quot;).popover({
  297. title: &quot;What's this&quot;,
  298. content: &quot;...&quot;,
  299. classes: &quot;wider&quot;
  300. });
  301. $(&quot;#ex7b&quot;).click(function(event) {
  302. event.preventDefault();
  303. event.stopPropagation();
  304. $(&quot;#ex7a&quot;).popover(
  305. 'ajax',
  306. &quot;ajax.html&quot;
  307. ).popover('title', &quot;It's AJAX content!&quot;).popover('show');
  308. });</code></pre>
  309. <p>Alternatively, you can set an URL in the initialization parameters to load an URL immediately on setup, like so:</p>
  310. <pre><code>$(&quot;#selector&quot;).popover({
  311. url: &quot;test.html&quot;
  312. });</code></pre>
  313. <a name="parameters"></a>
  314. <h3>Parameters</h3>
  315. <p>You may've noticed the <code>{ classes: "wider" }</code> parameter in the previous example. The value of the <code>classes</code>-parameter is applied to the popover by jQuery's <code>addClass()</code> method. You can use this to add classes for different sizes of popovers.</p>
  316. <p>There are other parameters you can pass to the <code>popover()</code> method. Following is a list of them.</p>
  317. <table>
  318. <thead>
  319. <tr>
  320. <th>Option</th>
  321. <th>Preffered type</th>
  322. <th>Description</th>
  323. <th>Default</th>
  324. <th>Since</th>
  325. </tr>
  326. </thead>
  327. <tbody>
  328. <tr>
  329. <td>verticalOffset</td>
  330. <td>int</td>
  331. <td><a name="parameters_verticalOffset" title="verticalOffset"></a>Offset the popover by y px vertically (movement depends on position of popover. If <code>position == 'bottom'</code>, positive numbers are down)</td>
  332. <td><code>10</code></td>
  333. <td>v1.0.0</td>
  334. </tr>
  335. <tr>
  336. <td>horizontalOffset</td>
  337. <td>int</td>
  338. <td><a name="parameters_horizontalOffset" title="horizontalOffset"></a>Offset the popover by x px horizontally (movement depends on position of popover. If <code>position == 'right'</code>, positive numbers are right)</td>
  339. <td><code>10</code></td>
  340. <td>v1.0.0</td>
  341. </tr>
  342. <tr>
  343. <td>title</td>
  344. <td>bool|string</td>
  345. <td><a name="parameters_title" title="title"></a>Contents of the heading. Set to false for no title.</td>
  346. <td><code>false</code></td>
  347. <td>v1.0.0</td>
  348. </tr>
  349. <tr>
  350. <td>content</td>
  351. <td>bool|string</td>
  352. <td><a name="parameters_content" title="content"></a>Contents of the body of the popover. Set to false for no body.</td>
  353. <td><code>false</code></td>
  354. <td>v1.0.0</td>
  355. </tr>
  356. <tr>
  357. <td>url</td>
  358. <td>bool|string</td>
  359. <td><a name="parameters_url" title="url"></a>Automatically load an URL into the content field on initialization, if set to an url.</td>
  360. <td><code>false</code></td>
  361. <td>v1.0.0</td>
  362. </tr>
  363. <tr>
  364. <td>classes</td>
  365. <td>string</td>
  366. <td><a name="parameters_classes" title="classes"></a>Add stylesheet classes to the popover box on initalization, for example "large".</td>
  367. <td><code>&quot;&quot;</code></td>
  368. <td>v1.0.0</td>
  369. </tr>
  370. <tr>
  371. <td>position</td>
  372. <td>string</td>
  373. <td><a name="parameters_position" title="position"></a>Determine place of the popover. Set to &quot;auto&quot; for automatic placement. <em>Yet to be implemented</em></td>
  374. <td><code>&quot;auto&quot;</code></td>
  375. <td>1.0.8</td>
  376. </tr>
  377. <tr>
  378. <td>fadeSpeed</td>
  379. <td>int</td>
  380. <td><a name="parameters_fadeSpeed" title="fadeSpeed"></a>How fast to fade this popover out when fading out.</td>
  381. <td><code>160</code></td>
  382. <td>v1.0.0</td>
  383. </tr>
  384. <tr>
  385. <td>trigger</td>
  386. <td>string</td>
  387. <td><a name="parameters_trigger" title="trigger"></a>How to trigger the popover. &quot;click&quot; activates the popover when the linked-to element is clicked, &quot;hover&quot; when it's hovered on, &quot;focus&quot; shows it when focused and hides the popover when unfocused/blurred, and everything else sets it to manual.</td>
  388. <td><code>&quot;click&quot;</code></td>
  389. <td>v1.0.0</td>
  390. </tr>
  391. <tr>
  392. <td>preventDefault</td>
  393. <td>bool</td>
  394. <td><a name="parameters_preventDefault" title="preventDefault"></a>Execute <code>event.preventDefault()</code> method on the element the popover is called on. Set this to false if you want the element (for example an <code>a</code>-element) to still execute code already bound with <code>.click()</code>.</td>
  395. <td><code>true</code></td>
  396. <td>v1.0.0</td>
  397. </tr>
  398. <tr>
  399. <td>stopChildrenPropagation</td>
  400. <td>bool</td>
  401. <td><a name="parameters_stopChildrenPropagation" title="stopChildrenPropagation"></a>Execute <code>event.preventPropagation()</code> method on all children of the popover, so <code>click</code> events won't bubble up and hide the popover.</td>
  402. <td><code>true</code></td>
  403. <td>v1.0.5</td>
  404. </tr>
  405. <tr>
  406. <td>hideOnHTMLClick</td>
  407. <td>bool</td>
  408. <td><a name="parameters_hideOnHTMLClick" title="hideOnHTMLClick"></a>Hide all popovers when clicked outside of them.</td>
  409. <td><code>true</code></td>
  410. <td>v1.0.0</td>
  411. </tr>
  412. <tr>
  413. <td>animateChange</td>
  414. <td>bool</td>
  415. <td><a name="parameters_animateChange" title="animateChange"></a>Animate a popover reposition. <em>Yet to be implemented.</em></td>
  416. <td><code>true</code></td>
  417. <td>-</td>
  418. </tr>
  419. <tr>
  420. <td>autoReposition</td>
  421. <td>bool</td>
  422. <td><a name="parameters_autoReposition" title="autoReposition"></a>Automatically reposition popover on popover change and window resize.</td>
  423. <td><code>true</code></td>
  424. <td>v1.0.8</td>
  425. </tr>
  426. <tr>
  427. <td>anchor</td>
  428. <td>bool|string|jQuery</td>
  429. <td><a name="parameters_anchor" title="anchor"></a>Use this parameter to anchor the popover to a different element than it's invoked on. This is useful when using <code>{ trigger: 'hover' }</code>.</td>
  430. <td><code>false</code></td>
  431. <td>v1.0.2</td>
  432. </tr>
  433. </tbody>
  434. </table>
  435. <a name="parameters_prototype" title="Default prototype"></a>
  436. <p>For convienience, here is this plugin's defaults prototype.</p>
  437. <pre><code>var defaults = {
  438. verticalOffset: 10,
  439. horizontalOffset: 10,
  440. title: false,
  441. content: false,
  442. url: false,
  443. classes: '',
  444. position: 'auto',
  445. fadeSpeed: 160,
  446. trigger: 'click',
  447. preventDefault: true,
  448. stopChildrenPropagation:
  449. hideOnHTMLClick: true,
  450. animateChange: true,
  451. autoReposition: true,
  452. anchor: false: false
  453. }</code></pre>
  454. <a name="methods"></a>
  455. <h3>Methods</h3>
  456. <p>Following is a reference of all methods you can call. Every method returns a jQuery result set, to maintain chainability.</p>
  457. <table>
  458. <thead>
  459. <tr>
  460. <th>Method</th>
  461. <th>Returns</th>
  462. <th>Description</th>
  463. <th>Usage</th>
  464. </tr>
  465. </thead>
  466. <tbody>
  467. <tr>
  468. <td>init</td>
  469. <td>jQuery</td>
  470. <td><a name="methods_init" title="init"></a>(default method) Initializes a popover on elements. Reads defaults (see above), combines them with parameters and makes and links the popover.</td>
  471. <td><code>$("#selector").popover(["init", ] { title: "Test" });</code></td>
  472. </tr>
  473. <tr>
  474. <td>destroy</td>
  475. <td>jQuery</td>
  476. <td><a name="methods_destroy" title="destroy"></a>Removes the linked popover(s) from the DOM, as well as it's data/settings.</td>
  477. <td><code>$("#selector").popover('destroy');</code></td>
  478. </tr>
  479. <tr>
  480. <td>show</td>
  481. <td>jQuery</td>
  482. <td><a name="methods_show" title="show"></a>Show a linked popover, if it exists.</td>
  483. <td><code>$("#selector").popover('show');</code></td>
  484. </tr>
  485. <tr>
  486. <td>hide</td>
  487. <td>jQuery</td>
  488. <td><a name="methods_hide" title="hide"></a>Hide a linked popover, if it exists.</td>
  489. <td><code>$("#selector").popover('hide');</code></td>
  490. </tr>
  491. <tr>
  492. <td>fadeOut</td>
  493. <td>jQuery</td>
  494. <td><a name="methods_fadeOut" title="fadeOut"></a>Fade out a linked popover, if it exists, in as many milliseconds you set the fadeSpeed parameter to on initialization, or how many as you passed to the method.</td>
  495. <td><code>$("#selector").popover('fadeOut' [, 1000]);</code></td>
  496. </tr>
  497. <tr>
  498. <td>hideAll</td>
  499. <td>jQuery</td>
  500. <td><a name="methods_hideAll" title="hideAll"></a>Hide all initialized popovers.</td>
  501. <td><code>$("#selector").popover('hideAll');</code></td>
  502. </tr>
  503. <tr>
  504. <td>fadeOutAll</td>
  505. <td>jQuery</td>
  506. <td><a name="methods_fadeOutAll" title="fadeOutAll"></a>Fade out all initialized popovers. The duration is set by using the parameter <code>fadeSpeed</code> when initiaizing, or passing this to the method.</td>
  507. <td><code>$("#selector").popover('fadeOutAll' [, 1000]);</code></td>
  508. </tr>
  509. <tr>
  510. <td>setTrigger</td>
  511. <td>jQuery</td>
  512. <td><a name="methods_setTrigger" title="setTrigger"></a>Sets a popover's trigger method (see <a href="#parameters_trigger">this</a> for information on triggers). Also unbinds the previous trigger(s).</td>
  513. <td><code>$("#selector").popover('setTrigger', 'hover');</code></td>
  514. </tr>
  515. <tr>
  516. <td>setOption</td>
  517. <td>jQuery</td>
  518. <td><a name="methods_setOption" title="setOption"></a>Sets an option to the specified value.</td>
  519. <td><code>$("#selector").popover('setOption', 'fadeSpeed', 500);</code></td>
  520. </tr>
  521. <tr>
  522. <td>getData</td>
  523. <td>mixed</td>
  524. <td><a name="methods_getData" title="getData"></a>Get a popover's data. If multiple elements are targeted, the function returns an array of objects.</td>
  525. <td><code>$("#selector").popover('getData');</code></td>
  526. </tr>
  527. </tbody>
  528. </table>
  529. <a name="download"></a>
  530. <h3>Download</h3>
  531. <p>You can download jQuery.popover by cloning it from Github:</p>
  532. <p><code>git clone git@github.com:klaas4/jQuery.popover.git</code></p>
  533. <p>Or simply download the <a href="https://github.com/klaas4/jQuery.popover/zipball/master">zip-package</a>.</p>
  534. <p>Please also check out my blog at <a href="http://daveyyzermans.nl/">http://daveyyzermans.nl/</a>, and if you want, shoot me an e-mail.</p>
  535. </body>
  536. </html>