diff --git a/README.md b/README.md index bc00669..d66ea36 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,57 @@ Tooltipster =========== -A jQuery tooltip plugin by Caleb Jacob. For documentation and all that jazz, -visit: http://calebjacob.com/tooltipster +A jQuery tooltip plugin by Caleb Jacob under MIT license. + +A reminder of options/methods lies below. For detailed documentation, visit http://iamceege.github.io/tooltipster/ + +Options +------------------------- + +animation +arrow +arrowColor +autoClose +content +contentAsHTML +contentCloning +delay +fixedWidth +maxWidth +functionInit +functionBefore +functionReady +functionAfter +icon +iconCloning +iconDesktop +iconTheme +iconTouch +interactive +interactiveTolerance +offsetX +offsetY +onlyOne +position +positionTracker +speed +timer +theme +touchDevices +trigger +updateAnimation + +Methods +------------------------- + +$.fn.tooltipster('setDefaults', {}) +$(...).tooltipster('show') +$(...).tooltipster('hide') +$(...).tooltipster('disable') +$(...).tooltipster('enable') +$(...).tooltipster('destroy') +$(...).tooltipster('content') +$(...).tooltipster('content', myNewContent) +$(...).tooltipster('reposition') +$(...).tooltipster('elementTooltip') +$(...).tooltipster('elementIcon') \ No newline at end of file diff --git a/bower.json b/bower.json index 8b3f0ca..b06a78d 100644 --- a/bower.json +++ b/bower.json @@ -1,8 +1,8 @@ { "name": "tooltipster", - "version": "2.3.0", + "version": "3.0.0", "main": ["js/jquery.tooltipster.min.js", "css/tooltipster.css"], "dependencies": { - "jquery": ">=1.4" + "jquery": ">=1.7" } } \ No newline at end of file diff --git a/demo/index.html b/demo/index.html new file mode 100644 index 0000000..5c4da3a --- /dev/null +++ b/demo/index.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + +
+ Google +
+ +
+ +
+ + + + +
+ + diff --git a/images/map.png b/demo/map.png similarity index 100% rename from images/map.png rename to demo/map.png diff --git a/css/reset.css b/demo/reset.css similarity index 100% rename from css/reset.css rename to demo/reset.css diff --git a/css/style.css b/demo/style.css similarity index 100% rename from css/style.css rename to demo/style.css diff --git a/doc/css/prettify.css b/doc/css/prettify.css new file mode 100644 index 0000000..90cfb39 --- /dev/null +++ b/doc/css/prettify.css @@ -0,0 +1,49 @@ +/* Pretty printing styles. Used with prettify.js. */ + +/* SPAN elements with the classes below are added by prettyprint. */ +.pln { color: #000 } /* plain text */ + +@media screen { + .str { color: #080 } /* string content */ + .kwd { color: #008 } /* a keyword */ + .com { color: #800 } /* a comment */ + .typ { color: #606 } /* a type name */ + .lit { color: #066 } /* a literal value */ + /* punctuation, lisp open bracket, lisp close bracket */ + .pun, .opn, .clo { color: #660 } + .tag { color: #008 } /* a markup tag name */ + .atn { color: #606 } /* a markup attribute name */ + .atv { color: #080 } /* a markup attribute value */ + .dec, .var { color: #606 } /* a declaration; a variable name */ + .fun { color: red } /* a function name */ +} + +/* Use higher contrast and text-weight for printable form. */ +@media print, projection { + .str { color: #060 } + .kwd { color: #006; font-weight: bold } + .com { color: #600; font-style: italic } + .typ { color: #404; font-weight: bold } + .lit { color: #044 } + .pun, .opn, .clo { color: #440 } + .tag { color: #006; font-weight: bold } + .atn { color: #404 } + .atv { color: #060 } +} + +/* Specify class=linenums on a pre to get line numbering */ +ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */ +li.L0, +li.L1, +li.L2, +li.L3, +li.L5, +li.L6, +li.L7, +li.L8 { list-style-type: none } +/* Alternate shading for lines */ +li.L1, +li.L3, +li.L5, +li.L7, +li.L9 { background: #eee } diff --git a/doc/css/reset.css b/doc/css/reset.css new file mode 100644 index 0000000..39a6a66 --- /dev/null +++ b/doc/css/reset.css @@ -0,0 +1,45 @@ +@charset "UTF-8"; + +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size:100%; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} + diff --git a/doc/css/style.css b/doc/css/style.css new file mode 100644 index 0000000..42eac54 --- /dev/null +++ b/doc/css/style.css @@ -0,0 +1,741 @@ +/*blue #0078c9 +orange #ff5e3c */ + +@import url(http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700); + +@font-face { + font-family: 'icomoon'; + src:url('../images/icons/icomoon.eot'); + src:url('../images/icons/icomoond41d.eot?#iefix') format('embedded-opentype'), + url('../images/icons/icomoon.svg#icomoon') format('svg'), + url('../images/icons/icomoon.woff') format('woff'), + url('../images/icons/icomoon.ttf') format('truetype'); + font-weight: normal; + font-style: normal; +} + +::selection { + background: #0078c9; + color: #fff; +} +::-moz-selection { + background: #0078c9; + color: #fff; +} + +body, html { + height: 100%; +} + +body { + color: #5d6365; + font-size: 1em; + line-height: 1.6em; + font-family: 'Open Sans', sans-serif; + font-weight: 300; + background: #5d6365; +} + +#background { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + overflow: hidden; +} +#background img { + min-height: 100%; + min-width: 100%; +} +#background:before { + content: ''; + display: block; + width: 100%; + height: 20%; + position: absolute; + bottom: 0; + background: -moz-linear-gradient(top, rgba(93,99,101,0) 0%, rgba(93,99,101,1) 100%); /* FF3.6+ */ + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(93,99,101,0)), color-stop(100%,rgba(93,99,101,1))); /* Chrome,Safari4+ */ + background: -webkit-linear-gradient(top, rgba(93,99,101,0) 0%,rgba(93,99,101,1) 100%); /* Chrome10+,Safari5.1+ */ + background: -o-linear-gradient(top, rgba(93,99,101,0) 0%,rgba(93,99,101,1) 100%); /* Opera 11.10+ */ + background: -ms-linear-gradient(top, rgba(93,99,101,0) 0%,rgba(93,99,101,1) 100%); /* IE10+ */ + background: linear-gradient(to bottom, rgba(93,99,101,0) 0%,rgba(93,99,101,1) 100%); /* W3C */ + filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#005d6365', endColorstr='#5d6365',GradientType=0 ); /* IE6-9 */ +} + +#wrapper { + width: 100%; + max-width: 1300px; + margin: 0 auto; + position: relative; + box-shadow: 0.6em 0px 15px rgba(0,0,0,0.1), -0.6em 0px 15px rgba(0,0,0,0.1); +} + +* { + -webkit-transition: all 300ms; + -moz-transition: all 300ms; + -o-transition: all 300ms; + -ms-transition: all 300ms; + transition: all 300ms; +} + +h1 { + font-weight: 300; + font-size: 1.4em; + line-height: 1.4em; + margin-bottom: 1.8em; +} +h2 { + color: #a9b1b3; + font-weight: 300; + font-size: 4em; + line-height: 1.4em; + margin-bottom: 0.5em; +} +h3 { + font-size: 2em; + line-height: 1.4em; + margin-bottom: 0.7em; + padding-top: 1em; +} +h4 { + font-size: 1.4em; + line-height: 1.4em; + font-weight: 400; + margin-bottom: 1em; +} +p { + margin-bottom: 1.5em; +} + +strong { + font-weight: 600; +} + +a { + text-decoration: none; + color: #0078c9; + font-weight: 600; +} +a:hover { + color: #a9b1b3; +} +a.alt { + color: rgba(255,255,255,0.75); +} +a.alt:hover { + color: rgba(255,255,255,1); +} + +a:before { + font-family: 'icomoon'; + font-style: normal; + speak: none; + font-weight: normal; + line-height: 1; + -webkit-font-smoothing: antialiased; +} + +a.button { + display: inline-block; + padding: 0.8em 1em; + border: 3px solid #ff5e3c; + border-radius: 6px; + color: #ff5e3c; + background: #fff; + font-weight: 600; +} +a.button:hover { + background: #ff5e3c; + color: #fff; +} +a.button.alt { + color: #ff5e3c; + border: none; +} +a.button.alt:hover { + background: #ff5e3c; + color: #fff; + border: none; +} +a.button:active { + -webkit-transform: scale3d(0.95,0.95,1); + -moz-transform: scale3d(0.95,0.95,1); + -o-transform: scale3d(0.95,0.95,1); + -ms-transform: scale3d(0.95,0.95,1); + transform: scale3d(0.95,0.95,1); +} + +a.white { + color: #fff; + padding-bottom: 3px; + border-bottom: 1px solid rgba(255,255,255,0); +} +a.white:hover { + border-bottom: 1px solid rgba(255,255,255,1); +} + +.row { + overflow: hidden; +} + +header { + background: #fff; + position: fixed; + top: 0; + right: 0; + left: 0; + width: 100%; + max-width: 1300px; + padding: 0 1.25em 0 2em; + margin: 0 auto; + box-shadow: 0px 3px 0px rgba(0,0,0,0.05); + box-sizing: border-box; + -moz-box-sizing: border-box; +} +header select { + display: none; +} + +section { + width: 100%; + margin: 0 auto; + overflow: hidden; + border-bottom: 2px dashed #e5eaeb; + padding: 6em; + background: #fff; + box-sizing: border-box; + -moz-box-sizing: border-box; +} +#talk { + border-bottom: none !important; +} + +footer { + width: 100%; + margin: 0 auto; + padding: 6em; + background: #0078c9; + color: #fff; + box-sizing: border-box; + -moz-box-sizing: border-box; + text-align: center; +} + +nav { + width: 100%; + max-width: 1300px; + box-sizing: border-box; + -moz-box-sizing: border-box; + background: #fff; + float: right; + z-index: 2; + text-align: right; +} +nav ul { + display: block; + width: auto; + float: right; +} +nav li { + display: inline-block; + margin: 0; + float: left; +} +nav a { + display: inline-block; + font-weight: 400; + color: #a9b1b3; + padding: 1.5em 0.75em; +} +nav a:hover { + background: #0078c9; + color: #fff; +} + +#mobile-nav { + display: none; +} + +#social { + width: auto; + position: absolute; + left: 0; + top: 0; + z-index: 3; +} +#social div { + float: left; + width: 90px; + padding: 1.5em 2em; +} +#tweet { + margin-top: 2px; +} +div#github { + position: relative; + bottom: 4px; + margin-left: 0px; + width: 90px; +} +#github a { + -webkit-transition: none; + -moz-transition: none; + -o-transition: none; + -ms-transition: none; + transition: none; +} + +pre { + box-sizing: border-box; + -moz-box-sizing: border-box; + padding: 3em; + background: #e6eff1; + box-shadow: 0px 0px 20px rgba(0,0,0,0.0); + margin-bottom: 4em; + white-space: pre-wrap; +} +pre:hover { + background: #fff; + box-shadow: 0px 0px 20px rgba(0,0,0,0.3); +} +pre:last-child { + margin-bottom: 0; +} + + +/* +------------------------------------- +Welcome +------------------------------------- +*/ + +#welcome { + text-align: center; + padding: 12em 0 9em; + color: #fff; + width: 100%; + border-bottom: none; + background: rgba(0,0,0,0.3); +} + +#welcome h1 { + display: block; + max-width: 635px; + margin-left: auto; + margin-right: auto; +} + +#tooltipster { + width: 100%; + max-width: 258px; + margin-bottom: 2em; +} + +#browser-support { + margin-bottom: 2.8em; +} +#browser-support li { + display: inline-block; + margin: 0.25em; + font-size: 0; + line-height: 0; +} +#browser-support li img { + height: 42px; + opacity: 0.5; +} +#browser-support li img:hover { + opacity: 1; +} + +#download { + font-size: 1.2em; + line-height: 1.4em; + width: 100%; +} +#download a.button { + margin-right: 0.6em; +} +#download a.button:before { + content: "\64"; + padding-right: 1em; + font-size: 0.9em; +} + + +/* +------------------------------------- +Demos +------------------------------------- +*/ + +#demos ul { + display: block; + width: 100%; + font-size: 1.4em; + line-height: 1.4em; +} +#demos li { + display: block; + width: 50%; + font-weight: 400; + margin-bottom: 1em; + overflow: hidden; + padding-top: 1.4em; + padding-right: 2em; + box-sizing: border-box; + -moz-box-sizing: border-box; + float: left; +} +#demos span { + display: block; + border: 3px solid #ff5e3c; + border-radius: 100%; + box-sizing: border-box; + -moz-box-sizing: border-box; + width: 5em; + height: 5em; + background: #ff5e3c; + color: #fff; + font-size: 0.6em; + line-height: 1em; + font-weight: 700; + padding: 1.8em 0 0 0; + text-align: center; + margin: -1.4em 1em 0 0; + text-transform: uppercase; + float: left; +} +#demos span:hover { + background: #fff !important; + color: #5d6365; + border: 3px solid #5d6365 !important; + cursor: pointer; +} + + +/* +------------------------------------- +Tooltips +------------------------------------- +*/ + +#demos span.tooltipster-icon { + cursor: help; + margin-left: 4px; + background: #0078c9; + border: 3px solid #0078c9; + width: 2.3em; + height: 2.3em; + padding: 0.4em 0 0; + margin: 2em 0 0 -3em; +} + +.tooltipster-default .tooltipster-content { + font-family: 'Open Sans', sans-serif; +} +.tooltipster-default .tooltipster-content img { + float: left; + margin-right: 10px; + border: 2px solid #000; +} +.tooltipster-default .tooltipster-content p { + margin: 0; +} +.tooltipster-default .tooltipster-content a { + color: #fff; + border-bottom: 1px solid rgba(255,255,255,0.4); +} +.tooltipster-default .tooltipster-content a:hover { + color: #fff; + border-bottom: 1px solid rgba(255,255,255,1); +} + +.tooltipster-blue { + background: #0078c9; + color: #fff; + border-radius: 5px; +} +.tooltipster-blue .tooltipster-content { + font-family: 'Open Sans', sans-serif; + font-size: 14px; + line-height: 16px; + padding: 8px 10px; +} + +.tooltipster-white { + background: #fff; + color: #0078c9; + border-radius: 5px; +} +.tooltipster-white .tooltipster-content { + font-family: 'Open Sans', sans-serif; + font-size: 14px; + line-height: 16px; + padding: 8px 10px; +} + +.tooltipster-pink { + background: url(../images/pattern-navy.png); + background-color: #ff3c70; + color: #fff; + border-radius: 5px; + box-shadow: inset -3px -3px 0 #ff3c70; +} +.tooltipster-pink .tooltipster-content { + font-family: 'Courier', monospace; + font-weight: 400; + font-size: 16px; + line-height: 16px; + padding: 15px 18px; +} + + +/* +------------------------------------- +Options +------------------------------------- +*/ + +table { + width: 100%; +} +table h4 { + margin-bottom: 0; +} +tr:nth-child(odd) { + background: #f4f5f7; +} +td { + padding: 2em; +} +td h4 { + font-family: 'Courier', monospace; + color: #0078c9; +} + + +/* +------------------------------------- +Themes +------------------------------------- +*/ + +#themes .themes a { + display: inline-block; + padding: 1em; + margin-right: 1em; + margin-bottom: 1em; + opacity: 0.8; +} +#themes a:hover { + opacity: 1; +} + +a.tooltipster-default-preview { + border-radius: 5px; + border: 2px solid #000; + background: #4c4c4c; + color: #fff; + font-family: Arial, sans-serif; + font-size: 14px; + line-height: 16px; + padding: 8px 10px; + font-weight: 400; + box-sizing: border-box; + -moz-box-sizing: border-box; +} + +a.tooltipster-light-preview { + border-radius: 5px; + border: 1px solid #cccccc; + background: #ededed; + color: #666666; + font-family: Arial, sans-serif; + font-size: 14px; + line-height: 16px; + padding: 8px 10px; + font-weight: 400; +} +.tooltipster-light { + border-radius: 5px; + border: 1px solid #cccccc; + background: #ededed; + color: #666666; +} +.tooltipster-light .tooltipster-content { + font-family: Arial, sans-serif; + font-size: 14px; + line-height: 16px; + padding: 8px 10px; +} + +a.tooltipster-punk-preview { + border-radius: 5px; + border-bottom: 3px solid #f71169; + background: #2a2a2a; + color: #fff; + font-family: 'Courier', monospace; + font-size: 14px; + line-height: 16px; + padding: 8px 10px; + font-weight: 400; +} +.tooltipster-punk { + border-radius: 5px; + border-bottom: 3px solid #f71169; + background: #2a2a2a; + color: #fff; +} +.tooltipster-punk .tooltipster-content { + font-family: 'Courier', monospace; + font-size: 14px; + line-height: 16px; + padding: 8px 10px; +} + +a.tooltipster-noir-preview { + border-radius: 0px; + border: 3px solid #2c2c2c; + background: #fff; + color: #2c2c2c; + font-family: 'Georgia', serif; + font-size: 14px; + line-height: 16px; + padding: 8px 10px; + font-weight: 400; +} +.tooltipster-noir { + border-radius: 0px; + border: 3px solid #2c2c2c; + background: #fff; + color: #2c2c2c; +} +.tooltipster-noir .tooltipster-content { + font-family: 'Georgia', serif; + font-size: 14px; + line-height: 16px; + padding: 8px 10px; +} + +a.tooltipster-shadow-preview { + border-radius: 5px; + background: #fff; + box-shadow: 0px 0px 14px rgba(0,0,0,0.3); + color: #2c2c2c; + font-family: 'Arial', sans-serif; + font-size: 14px; + line-height: 16px; + padding: 8px 10px; + font-weight: 400; +} +.tooltipster-shadow { + border-radius: 5px; + background: #fff; + box-shadow: 0px 0px 14px rgba(0,0,0,0.3); + color: #2c2c2c; +} +.tooltipster-shadow .tooltipster-content { + font-family: 'Arial', sans-serif; + font-size: 14px; + line-height: 16px; + padding: 8px 10px; +} + + +/* +------------------------------------- +Talk +------------------------------------- +*/ + +#talk h3 { + margin-bottom: 1em; +} + + +/* +------------------------------------- +Breakpoints +------------------------------------- +*/ + +@media all and (max-width : 1100px) { + #tweet, #gplus { + display: none; + } + #demos li { + width: 100%; + } + table, tr, td { + display: block; + } + td { + padding: 2em 2em 0 2em; + } + td:last-child { + padding-bottom: 2em; + } +} + +@media all and (max-width : 920px) { + #demos ul { + width: 100%; + padding: 0; + } +} + +@media all and (max-width : 820px) { + nav ul { + display: none; + } + #social div { + padding: 0.5em 0.7em; + } + header { + padding: 0; + } + header select { + display: block; + float: right; + margin: 1em 1em; + } + section { + padding: 3em; + } + #welcome { + padding: 7.4em 3em 6em; + } + #download span { + display: block; + margin-top: 0.5em; + } +} + +@media all and (max-width : 450px) { + table h4 { + font-size: 1em; + line-height: 1em; + } + section { + padding: 2em; + } + h2 { + font-size: 3em; + line-height: 1.2em; + margin-bottom: 0.23em; + } + h3 { + font-size: 1.4em; + line-height: 1.4em; + margin-bottom: 1.3em; + } + h4 { + font-size: 1.2em; + } + pre { + padding: 1em; + } +} \ No newline at end of file diff --git a/doc/images/browser-chrome.png b/doc/images/browser-chrome.png new file mode 100644 index 0000000..7e76da6 Binary files /dev/null and b/doc/images/browser-chrome.png differ diff --git a/doc/images/browser-firefox.png b/doc/images/browser-firefox.png new file mode 100644 index 0000000..555cb5b Binary files /dev/null and b/doc/images/browser-firefox.png differ diff --git a/doc/images/browser-ie.png b/doc/images/browser-ie.png new file mode 100644 index 0000000..8c63137 Binary files /dev/null and b/doc/images/browser-ie.png differ diff --git a/doc/images/browser-opera.png b/doc/images/browser-opera.png new file mode 100644 index 0000000..f6997a3 Binary files /dev/null and b/doc/images/browser-opera.png differ diff --git a/doc/images/browser-safari.png b/doc/images/browser-safari.png new file mode 100644 index 0000000..0ab4cc3 Binary files /dev/null and b/doc/images/browser-safari.png differ diff --git a/doc/images/favicon.png b/doc/images/favicon.png new file mode 100644 index 0000000..80d6911 Binary files /dev/null and b/doc/images/favicon.png differ diff --git a/doc/images/icons/icomoon.eot b/doc/images/icons/icomoon.eot new file mode 100644 index 0000000..520f558 Binary files /dev/null and b/doc/images/icons/icomoon.eot differ diff --git a/doc/images/icons/icomoon.svg b/doc/images/icons/icomoon.svg new file mode 100644 index 0000000..7a26a2d --- /dev/null +++ b/doc/images/icons/icomoon.svg @@ -0,0 +1,16 @@ + + + + +This is a custom SVG font generated by IcoMoon. + + + + + + + + + + + \ No newline at end of file diff --git a/doc/images/icons/icomoon.ttf b/doc/images/icons/icomoon.ttf new file mode 100644 index 0000000..16ba996 Binary files /dev/null and b/doc/images/icons/icomoon.ttf differ diff --git a/doc/images/icons/icomoon.woff b/doc/images/icons/icomoon.woff new file mode 100644 index 0000000..e370491 Binary files /dev/null and b/doc/images/icons/icomoon.woff differ diff --git a/doc/images/icons/icomoond41d.eot b/doc/images/icons/icomoond41d.eot new file mode 100644 index 0000000..520f558 Binary files /dev/null and b/doc/images/icons/icomoond41d.eot differ diff --git a/doc/images/large-background.jpg b/doc/images/large-background.jpg new file mode 100644 index 0000000..47bafb4 Binary files /dev/null and b/doc/images/large-background.jpg differ diff --git a/doc/images/pattern-navy.png b/doc/images/pattern-navy.png new file mode 100644 index 0000000..8c6bb56 Binary files /dev/null and b/doc/images/pattern-navy.png differ diff --git a/doc/images/social.jpg b/doc/images/social.jpg new file mode 100644 index 0000000..f36164a Binary files /dev/null and b/doc/images/social.jpg differ diff --git a/doc/images/spiderman.png b/doc/images/spiderman.png new file mode 100644 index 0000000..ccd88fd Binary files /dev/null and b/doc/images/spiderman.png differ diff --git a/doc/images/tooltipster.svg b/doc/images/tooltipster.svg new file mode 100644 index 0000000..cd43a09 --- /dev/null +++ b/doc/images/tooltipster.svg @@ -0,0 +1,212 @@ + + + + + + + + + + + + + + diff --git a/doc/js/jquery.jgfeed.js b/doc/js/jquery.jgfeed.js new file mode 100644 index 0000000..36059ee --- /dev/null +++ b/doc/js/jquery.jgfeed.js @@ -0,0 +1,34 @@ +/* + * jGFeed 1.0 - Google Feed API abstraction plugin for jQuery + * + * Copyright (c) 2009 jQuery HowTo + * + * Licensed under the GPL license: + * http://www.gnu.org/licenses/gpl.html + * + * URL: + * http://jquery-howto.blogspot.com + * + * Author URL: + * http://me.boo.uz + * + */ +(function($){ + $.extend({ + jGFeed : function(url, fnk, num, key){ + // Make sure url to get is defined + if(url == null) return false; + // Build Google Feed API URL + var gurl = "http://ajax.googleapis.com/ajax/services/feed/load?v=1.0&callback=?&q="+url+"?"; + if(num != null) gurl += "&num="+num; + if(key != null) gurl += "&key="+key; + // AJAX request the API + $.getJSON(gurl, function(data){ + if(typeof fnk == 'function') + fnk.call(this, data.responseData.feed); + else + return false; + }); + } + }); +})(jQuery); \ No newline at end of file diff --git a/doc/js/lang-css.js b/doc/js/lang-css.js new file mode 100644 index 0000000..034bd59 --- /dev/null +++ b/doc/js/lang-css.js @@ -0,0 +1,78 @@ +// Copyright (C) 2009 Google Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + + + +/** + * @fileoverview + * Registers a language handler for CSS. + * + * + * To use, include prettify.js and this file in your HTML page. + * Then put your code in an HTML tag like + *

+ *
+ *
+ * http://www.w3.org/TR/CSS21/grammar.html Section G2 defines the lexical
+ * grammar.  This scheme does not recognize keywords containing escapes.
+ *
+ * @author mikesamuel@gmail.com
+ */
+
+PR['registerLangHandler'](
+    PR['createSimpleLexer'](
+        [
+         // The space production 
+         [PR['PR_PLAIN'],       /^[ \t\r\n\f]+/, null, ' \t\r\n\f']
+        ],
+        [
+         // Quoted strings.   and 
+         [PR['PR_STRING'],
+          /^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/, null],
+         [PR['PR_STRING'],
+          /^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/, null],
+         ['lang-css-str', /^url\(([^\)\"\']*)\)/i],
+         [PR['PR_KEYWORD'],
+          /^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,
+          null],
+         // A property name -- an identifier followed by a colon.
+         ['lang-css-kw', /^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],
+         // A C style block comment.  The  production.
+         [PR['PR_COMMENT'], /^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],
+         // Escaping text spans
+         [PR['PR_COMMENT'], /^(?:)/],
+         // A number possibly containing a suffix.
+         [PR['PR_LITERAL'], /^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],
+         // A hex color
+         [PR['PR_LITERAL'], /^#(?:[0-9a-f]{3}){1,2}/i],
+         // An identifier
+         [PR['PR_PLAIN'],
+          /^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],
+         // A run of punctuation
+         [PR['PR_PUNCTUATION'], /^[^\s\w\'\"]+/]
+        ]),
+    ['css']);
+PR['registerLangHandler'](
+    PR['createSimpleLexer']([],
+        [
+         [PR['PR_KEYWORD'],
+          /^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]
+        ]),
+    ['css-kw']);
+PR['registerLangHandler'](
+    PR['createSimpleLexer']([],
+        [
+         [PR['PR_STRING'], /^[^\)\"\']+/]
+        ]),
+    ['css-str']);
diff --git a/doc/js/prettify.js b/doc/js/prettify.js
new file mode 100644
index 0000000..f66f6f2
--- /dev/null
+++ b/doc/js/prettify.js
@@ -0,0 +1,28 @@
+var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
+(function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
+[],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
+l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
+q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
+q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
+"");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
+a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
+for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
+"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
+H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
+J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
+I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\S\s]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\S\s]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),
+["default-markup","htm","html","mxml","xhtml","xml","xsl"]);k(x([["pln",/^\s+/,q," \t\r\n"],["atv",/^(?:"[^"]*"?|'[^']*'?)/,q,"\"'"]],[["tag",/^^<\/?[a-z](?:[\w-.:]*\w)?|\/?>$/i],["atn",/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^\s"'>]*(?:[^\s"'/>]|\/(?=\s)))/],["pun",/^[/<->]+/],["lang-js",/^on\w+\s*=\s*"([^"]+)"/i],["lang-js",/^on\w+\s*=\s*'([^']+)'/i],["lang-js",/^on\w+\s*=\s*([^\s"'>]+)/i],["lang-css",/^style\s*=\s*"([^"]+)"/i],["lang-css",/^style\s*=\s*'([^']+)'/i],["lang-css",
+/^style\s*=\s*([^\s"'>]+)/i]]),["in.tag"]);k(x([],[["atv",/^[\S\s]+/]]),["uq.val"]);k(u({keywords:F,hashComments:!0,cStyleComments:!0,types:K}),["c","cc","cpp","cxx","cyc","m"]);k(u({keywords:"null,true,false"}),["json"]);k(u({keywords:H,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:K}),["cs"]);k(u({keywords:G,cStyleComments:!0}),["java"]);k(u({keywords:v,hashComments:!0,multiLineStrings:!0}),["bsh","csh","sh"]);k(u({keywords:I,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),
+["cv","py"]);k(u({keywords:"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["perl","pl","pm"]);k(u({keywords:J,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb"]);k(u({keywords:w,cStyleComments:!0,regexLiterals:!0}),["js"]);k(u({keywords:"all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes",
+hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]);k(x([],[["str",/^[\S\s]+/]]),["regex"]);window.prettyPrintOne=function(a,m,e){var h=document.createElement("PRE");h.innerHTML=a;e&&D(h,e);E({g:m,i:e,h:h});return h.innerHTML};window.prettyPrint=function(a){function m(){for(var e=window.PR_SHOULD_USE_CONTINUATION?l.now()+250:Infinity;p=0){var k=k.match(g),f,b;if(b=
+!k){b=n;for(var o=void 0,c=b.firstChild;c;c=c.nextSibling)var i=c.nodeType,o=i===1?o?b:c:i===3?N.test(c.nodeValue)?b:o:o;b=(f=o===b?void 0:o)&&"CODE"===f.tagName}b&&(k=f.className.match(g));k&&(k=k[1]);b=!1;for(o=n.parentNode;o;o=o.parentNode)if((o.tagName==="pre"||o.tagName==="code"||o.tagName==="xmp")&&o.className&&o.className.indexOf("prettyprint")>=0){b=!0;break}b||((b=(b=n.className.match(/\blinenums\b(?::(\d+))?/))?b[1]&&b[1].length?+b[1]:!0:!1)&&D(n,b),d={g:k,h:n,i:b},E(d))}}p

Soufflé chocolate cake powder. Applicake lollipop oat cake gingerbread.

'), + fixedWidth: 300, + position: 'right' + }); + $('#demo-theme').tooltipster({ + animation: 'grow', + theme: '.tooltipster-pink' + }); + $('#demo-callback').tooltipster({ + content: 'Loading...', + updateAnimation: false, + functionBefore: function(origin, continueTooltip) { + continueTooltip(); + + if (origin.data('ajax') !== 'cached') { + + $.jGFeed('http://ws.audioscrobbler.com/2.0/user/ce3ge/recenttracks.rss?', + function(feeds){ + var content = ''; + if(!feeds){ + content = 'Woops - there was an error retrieving my last.fm RSS feed'; + origin.tooltipster('content', content); + } + else { + content = $('I last listened to: ' + feeds.entries[0].title + ''); + origin + .tooltipster('content', content) + .data('ajax', 'cached'); + } + }, 10); + + origin.data('ajax', 'cached'); + } + }, + functionAfter: function(origin) { + alert('The tooltip has closed!'); + } + }); + $('#demo-events').tooltipster({ + trigger: 'click' + }); + $(window).keypress(function() { + $('#demo-events').tooltipster('hide'); + }); + $('#demo-interact').tooltipster({ + contentAsHTML: true, + interactive: true + }); + $('#demo-touch').tooltipster({ + touchDevices: false + }); + $('#demo-icon').tooltipster({ + iconDesktop: true, + iconTouch: true + }); + $('.tooltipster-light-preview').tooltipster({ + theme: '.tooltipster-light' + }); + $('.tooltipster-punk-preview').tooltipster({ + theme: '.tooltipster-punk' + }); + $('.tooltipster-noir-preview').tooltipster({ + theme: '.tooltipster-noir' + }); + $('.tooltipster-shadow-preview').tooltipster({ + theme: '.tooltipster-shadow' + }); + + $('header select').change(function() { + var goTo = $(this).val(); + var section = $('#'+goTo); + var offset = section.offset().top; + $('html, body').scrollTop(offset); + }); + + prettyPrint(); + + +}); \ No newline at end of file diff --git a/index.html b/index.html index 37f9e87..cb3fdd1 100644 --- a/index.html +++ b/index.html @@ -1,40 +1,586 @@ - + Tooltipster - The jQuery Tooltip Plugin - - - + + + + + + + + + + + + + + + + + + - + + + + + - + + +
+ +
+
+
+ Tooltipster +

A powerful, flexible jQuery plugin enabling you to easily create semantic, modern tooltips enhanced with the power of CSS.

+
    +
  • + Chrome +
  • +
  • + Safari +
  • +
  • + Opera +
  • +
  • + FireFox +
  • +
  • + Internet Explorer +
  • +
+ +
+ +
+

Demos

+
    +
  • + Hover Default settings +
  • +
  • + Hover Fixed width, position, & HTML +
  • +
  • + Click Custom show / hide triggers +
  • +
  • + Hover Disable touch devices +
  • +
  • + Hover Custom themes & animations +
  • +
  • + Hover Custom callbacks (AJAX <3) +
  • +
  • + Hover Interaction with tooltips +
  • +
  • + Attach tooltips to icons +
  • +
  • ...& more!
  • +
+
+ +
+

Getting Started

+

1. Load jQuery and include Tooltipster's plugin files

+

After you download Tooltipster, move tooltipster.css and jquery.tooltipster.min.js to your root's CSS and JavaScript directories. Next, load jQuery and include Tooltipster's CSS and JavaScript files inside of your tags:

+
+<head>
+...
+
+    <link rel="stylesheet" type="text/css" href="css/tooltipster.css" />
+
+    <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.0.min.js"></script>
+    <script type="text/javascript" src="js/jquery.tooltipster.min.js"></script>
+
+...
+</head>
+
+

2. Set up your HTML

+

In order for Tooltipster to work, we first need to add the .tooltip class (or whatever class / means of selection you'd like to use) to whatever element we wish to have a tooltip. Next, we'll set the title attribute to whatever we'd like our tooltip to say. Here are a few examples:

+

Adding a tooltip to an image:

+
+<img src="my-image.png" class="tooltip" title="This is my image's tooltip message!" />
+

Adding a tooltip to a link that already has a class:

+
+<a href="http://calebjacob.com" class="ketchup tooltip" title="This is my link's tooltip message!">Link</a>
+

Adding a tooltip to a div:

+
+<div class="tooltip" title="This is my div's tooltip message!"> 
+    This div has a tooltip when you hover over it!
+</div>
+ +

3. Activate Tooltipster

+

The last thing we have to do is activate the plugin. To do this, add the following script right before your closing </head> tag (using whatever selector you'd like - in this case we're using the .tooltip class):

+
+<head>
+
+    ...
+
+    <script>
+        $(document).ready(function() {
+            $('.tooltip').tooltipster();
+        });
+    </script>
+</head>
+ +

4. Taking It a Step Further

+

Using HTML tags inside your tooltips

+

Tooltipster allows you to use any HTML markup you can think of inside your tooltips. This means you can insert things like images and text formatting tags. To achieve this, the recommended method is a little different : provide your content as a jQuery object in the script rather than in the title attribute :

+
+<head>
+
+    ...
+
+    <script>
+        $(document).ready(function() {
+            $('#my-tooltip').tooltipster({
+                content: $('<span><img src="my-image.png" /> <strong>This text is in bold case !</strong></span>')
+            });
+        });
+    </script>
+</head>
+<body>
+    
+    <div id="my-tooltip"> 
+        This div has a tooltip with HTML when you hover over it!
+    </div>
+	
+</body>
+ +

Another (less recommended) way of achieving this is to put encoded HTML markup directly in your title attribute and set the 'contentAsHTML' option to 'true'. In all cases, make sure you have tight control over the content you wish to display in the tooltip, as unwanted <script> or <iframe> tags for example would be a serious security issue for your website.

+ +
+<head>
+
+    ...
+
+    <script>
+        $(document).ready(function() {
+            $('.tooltip').tooltipster({
+                contentAsHTML: true
+            });
+        });
+    </script>
+</head>
+<body>
+    
+    <div class="tooltip" title="&lt;img src=&quot;my-image.png&quot; /&gt; &lt;strong&gt; This text is in bold case !&lt;/strong&gt;"> 
+        This div has a tooltip with HTML when you hover over it!
+    </div>
+	
+</body>
+ +

Customizing Your Tooltipster's Style

+

The style of your Tooltipsters can be easily changed by modifying or overriding the default Tooltipster theme in the tooltipster.css file. You also have the option to create and attach a brand new theme (comes in handy if you want to use more than one theme at once). To do this, start with this example and add your flair:

+
+.my-custom-theme {
+	border-radius: 5px; 
+	border: 2px solid #000;
+	background: #4c4c4c;
+	color: #fff;
+}
 
-	
- Google -
- -
-
- Hover here -
- Google -
- -
- - - - -
+/* Use this next selector to style things like font-size and line-height: */ +.my-custom-theme .tooltipster-content { + font-family: Arial, sans-serif; + font-size: 14px; + line-height: 16px; + padding: 8px 10px; +}
+

After you have created your new theme, don't forget to specify it in your Tooltipster settings:

+
+$('.tooltip').tooltipster({
+    theme: 'my-custom-theme'
+});
+ +

Customizing Tooltipster's Functionality

+

Tooltipster's options gives you a wide range of variables to tweak your tooltip to your heart's content. To learn more about all of the options, read the documentation section. Here's just a few of the things you can play with:

+
+$('.tooltip').tooltipster({
+   animation: 'fade',
+   delay: 200,
+   theme: 'tooltipster-default',
+   touchDevices: false,
+   trigger: 'hover'
+});
+
+ +
+

Options

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

animation

fade, grow, swing, slide, fallDetermines how the tooltip will animate in and out. Feel free to modify or create custom transitions in the tooltipster.css file. In IE9 and 8, all animations default to a JavaScript generated, fade animation. Default: 'fade'

arrow

booleanAdds the "speech bubble arrow" to the tooltip. Default: true

arrowColor

hex code / rgbSelect a specific color for the "speech bubble arrow". Default: will inherit the tooltip's background color

autoClose

booleanIf autoClose is set to false, the tooltip will never close unless you call the 'close' method yourself. Default: true

content

string, jQuery objectIf set, this will override the content of the tooltip. Default: null

contentAsHTML

booleanIf the content of the tooltip is provided as a string, it is displayed as plain text by default. If this content should actually be interpreted as HTML, set this option to true. Default: false

contentCloning

booleanIf you provide a jQuery object to the 'content' option, this sets if it is a clone of this object that should actually be used. Default: true

delay

integerDelay how long it takes (in milliseconds) for the tooltip to start animating in. Default: 200

fixedWidth

integerSet a fixed width for the tooltip. The tooltip will always be a consistent width - no matter your content size. Default: 0 (auto width)

maxWidth

integerSet a max width for the tooltip. If the tooltip ends up being smaller than the set max width, the tooltip's width will be set automatically. Default: 0 (no max width)

functionInit

functionCreate a custom function to be fired only once at instantiation. If the function returns a value, this value will become the content of the tooltip. See the advanced section to learn more. Default: function(origin, content) {}

functionBefore

functionCreate a custom function to be fired before the tooltip opens. This function may prevent or hold off the opening. See the advanced section to learn more. Default: function(origin, continueTooltip) { continueTooltip(); }

functionReady

functionCreate a custom function to be fired when the tooltip and its contents have been added to the DOM. Default: function(origin, tooltip) {}

functionAfter

functionCreate a custom function to be fired once the tooltip has been closed and removed from the DOM. Default: function(origin) {}

icon

string, jQuery objectIf using the iconDesktop or iconTouch options, this sets the content for your icon. Default: '(?)'

iconCloning

booleanIf you provide a jQuery object to the 'icon' option, this sets if it is a clone of this object that should actually be used. Default: true

iconDesktop

booleanGenerate an icon next to your content that is responsible for activating the tooltip on non-touch devices. Default: false

iconTheme

CSS classIf using the iconDesktop or iconTouch options, this sets the class on the icon (used to style the icon). Default: 'tooltipster-icon'

iconTouch

booleanGenerate an icon next to your content that is responsible for activating the tooltip on touch devices (tablets, phones, etc). Default: false

interactive

booleanGive users the possibility to interact with the tooltip. Unless autoClose is set to false, the tooltip will still close if the user moves away from or clicks out of the tooltip. Default: false

interactiveTolerance

integerIf the tooltip is interactive and activated by a hover event, set the amount of time (milliseconds) allowed for a user to hover off of the tooltip activator (origin) on to the tooltip itself - keeping the tooltip from closing. Default: 350

offsetX

integerOffsets the tooltip (in pixels) farther left/right from the origin. Default: 0

offsetY

integerOffsets the tooltip (in pixels) farther up/down from the origin. Default: 0

onlyOne

booleanIf true, only one tooltip will be allowed to be active at a time. Non-autoclosing tooltips will not be closed though. Default: false

position

right, left, top, top-right, top-left, bottom, bottom-right, bottom-leftSet the position of the tooltip. Default: 'top'

positionTracker

booleanWill reposition the tooltip if the origin moves. As this option may have an impact on performance, we suggest you enable it only if you need to. Default: false

speed

integerSet the speed of the animation. Default: 350

timer

integerHow long the tooltip should be allowed to live before closing. Default: 0 (disabled)

theme

CSS classSet the theme used for your tooltip. Default: 'tooltipster-default'

touchDevices

booleanIf set to false, tooltips will not show on pure-touch devices, unless you open them yourself with the 'show' method. Touch gestures on devices which also have a mouse will still open the tooltips though. Default: true

trigger

hover, click, customSet how tooltips should be activated and closed. See the advanced section to learn how to build custom triggers. Default: 'hover'

updateAnimation

booleanIf a tooltip is open while its content is updated, play a subtle animation when the content changes. Default: true
+
+ +
+

Advanced

+ +

The awesomesauce Tooltipster API

+

The Tooltipster API was created to be as flexible and easy to use as possible (thanks to glebtv for the inspiration). The API allows you to create custom triggers, update tooltip content on the fly (whether the tooltip is currently open or not), destroy Tooltipster functionality if needed, and reposition tooltips for unique use cases.

+

Here is a quick look at all of the API methods:

+
+// set default options for all future tooltip instantiations
+$.fn.tooltipster('setDefaults', {
+  position: 'bottom'
+});
+
+// show a tooltip
+$(...).tooltipster('show');
+
+// hide a tooltip
+$(...).tooltipster('hide');
+
+// temporarily disable a tooltip from being able to open
+$(...).tooltipster('disable');
+
+// if a tooltip was disabled from opening, reenable its previous functionality
+$(...).tooltipster('enable');
+
+// hide and destroy tooltip functionality
+$(...).tooltipster('destroy');
+
+// return a tooltip's current content (if selector contains multiple origins, only the value of the first will be returned)
+$(...).tooltipster('content');
+
+// update tooltip content
+$(...).tooltipster('content', myNewContent);
+
+// reposition and resize the tooltip
+$(...).tooltipster('reposition');
+
+// return the HTML root element of the tooltip
+$(...).tooltipster('elementTooltip');
+
+// return the HTML root element of the icon if there is one, 'undefined' otherwise
+$(...).tooltipster('elementIcon');
+ +

Using AJAX to generate your tooltip content

+

Tooltipster gives you the ability to fire a custom synchronous or asynchronous function everytime before the tooltip launches (functionBefore) or just once upon instantiation (functionInit). One great use for this is to grab dynamic content for your tooltips via AJAX.

+

Here is an example of using functionBefore() asynchronously to replace a loading notification with our AJAX call. Once the content has been retrieved and updated, we'll take advantage of setting $.data() to keep our content cached for the next time the tooltip is opened:

+
+$('.tooltip').tooltipster({
+    content: 'Loading...',
+    functionBefore: function(origin, continueTooltip) {
+
+        // we'll make this function asynchronous and allow the tooltip to go ahead and show the loading notification while fetching our data
+        continueTooltip();
+        
+        // next, we want to check if our data has already been cached
+        if (origin.data('ajax') !== 'cached') {
+            $.ajax({
+                type: 'POST',
+                url: 'example.php',
+                success: function(data) {
+                    // update our tooltip content with our returned data and cache it
+                    origin.tooltipster('content', data).data('ajax', 'cached');
+                }
+            });
+        }
+    }
+});
+

However, maybe you just need to make one call and only need it to fire once instead of everytime the tooltip opens. This is where you could use functionInit(). This function will fire only once - right at the beginning of the instantiation process. You'll have the ability to do things like check the current content and set new content. Since the fancy API methods for returning and setting the value aren't instantiated yet, the way we go about this is a little different than functionBefore(): +

+$('.tooltip').tooltipster({
+    functionInit: function(origin, content) {
+		
+        if (content === 'This is bad content') {
+            
+            // when the request has finished loading, we will change the tooltip's content
+            $.ajax({
+                type: 'POST',
+                url: 'example.php',
+                success: function(data) {
+                    origin.tooltipster('content', 'New content has been loaded : ' + data);
+                }
+            });
+			
+            // this returned string will overwrite the content of the tooltip for the time being
+            return 'Wait while we load new content...';
+        }
+        else {
+            // return nothing : the initialization continues normally with its content unchanged.
+        }
+    }
+});
+ +

Manually launch and hide a tooltip

+

Tooltipster gives you complete freedom with how you'd like to open and close tooltips. You do not need to set your trigger option to 'custom' for this to work. If you have your trigger set to 'hover', the tooltip can be triggered by custom events as well as have the default hover functionality.

+

Here's an example of how you could launch a specific tooltip on page load and close it when any key on your keyboard is pressed. This will still preserve the default hover trigger.

+
+<span class="tooltip" id="example" title="My tooltip content">Example</span>
+
+
+// first, launch the Tooltipster plugin
+$(document).ready(function() {
+   $('.tooltip').tooltipster();
+});
+   
+// on window load, show the tooltip
+$(window).load(function() {
+   $('#example').tooltipster('show');
+      
+   // once a key is pressed on your keyboard, hide the tooltip
+   $(window).keypress(function() {
+      $('#example').tooltipster('hide');
+   });
+});
+
+ +

Updating a tooltip's content

+

It's easy as pie to update a tooltip's content - whether it's open or closed. Depending on your selector, you can update multiple tooltips at once or just one:

+
+$('#my-special-tooltip').tooltipster('content', 'My new content');
+

By default, Tooltipster will play a subtle animation when the content changes. To tweak the animation, check out the '.tooltipster-content-changing' class in your tooltipster.css file. It's important to note that only CSS transforms will be animated. To disable this animation, set updateAnimation to false.

+ +

Community submitted use cases

+

Using Tooltipster alongside jQuery Validate by sparky672

+

Did you do something awesome with Tooltipster? Tell me and I'll post it up here!

+
+ +
+

Themes

+

Tired of the same old? Download some rocking themes for your Tooltipsters (or create and share your own)! Click to download.

+
+ Default + Light + Punk + Noir + Shadow +
+
+ +
+

Talk

+

Share thoughts, questions, & bugs!

+

Head on over to Tooltipster's issue tracker on GitHub: https://github.com/iamceege/tooltipster/issues

+

Before opening a new issue, please be sure to search through the backlog to see if your question or bug has been / is being resolved. Thank you! :)

+
+ + + +
+
+
+ Fork +
+
+ + +
+
+ +
+
+ + +
+
+ +
+ + + diff --git a/js/jquery.tooltipster.js b/js/jquery.tooltipster.js index 607a6c8..b6e6a15 100644 --- a/js/jquery.tooltipster.js +++ b/js/jquery.tooltipster.js @@ -1,6 +1,6 @@ /* -Tooltipster 2.3.0rc3 | 10/26/13 +Tooltipster 3.0.0rc1 | 2013-12-22 A rockin' custom tooltip jQuery plugin Developed by Caleb Jacob under the MIT license http://opensource.org/licenses/MIT @@ -16,7 +16,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI animation: 'fade', arrow: true, arrowColor: '', + autoClose: true, content: null, + contentAsHTML: false, contentCloning: true, delay: 200, fixedWidth: 0, @@ -31,10 +33,9 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI iconCloning: true, iconDesktop: false, iconTouch: false, - iconTheme: '.tooltipster-icon', + iconTheme: 'tooltipster-icon', interactive: false, interactiveTolerance: 350, - interactiveAutoClose: true, offsetX: 0, offsetY: 0, onlyOne: false, @@ -42,7 +43,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI positionTracker: false, speed: 350, timer: 0, - theme: '.tooltipster-default', + theme: 'tooltipster-default', touchDevices: true, trigger: 'hover', updateAnimation: true @@ -62,12 +63,23 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI // this will be the element which triggers the appearance of the tooltip on hover/click/custom events. // it will be the same as this.$el if icons are not used (see in the options), otherwise it will correspond to the created icon this.$elProxy; + this.enabled = true; this.options = $.extend({}, defaults, options); - this.timer = null; + this.mouseIsOverProxy = false; + // a unique namespace per instance, for easy selective unbinding + this.namespace = 'tooltipster-'+ Math.round(Math.random()*100000); + // status can be either : appearing, shown, disappearing, hidden + this.status = 'hidden'; + this.timerHide = null; + this.timerShow = null; // this will be the tooltip element (jQuery wrapped HTML element) this.$tooltip; this.tooltipArrowReposition; + // for backward compatibility + this.options.iconTheme = this.options.iconTheme.replace('.', ''); + this.options.theme = this.options.theme.replace('.', ''); + // launch this.init(); @@ -86,18 +98,18 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI // if content is provided in the options, its has precedence over the title attribute. Remark : an empty string is considered content, only 'null' represents the absence of content. if (self.options.content !== null){ - self.updateContent(self.options.content); + self.setContent(self.options.content); } else { // the same remark as above applies : empty strings (like title="") are considered content and will be shown. Do not define any attribute at all if you want to initialize the plugin without content at start. var t = self.$el.attr('title'); if(typeof t === 'undefined') t = null; - self.updateContent(t); + self.setContent(t); } var c = self.options.functionInit(self.$el, self.content); - if(c) self.updateContent(c); + if(typeof c !== 'undefined') self.setContent(c); self.$el // strip the title off of the element to prevent the default tooltips from popping up @@ -107,7 +119,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI // detect if we're changing the tooltip origin to an icon // note about this condition : if the device has touch capability and self.options.iconTouch is false, you'll have no icons event though you may consider your device as a desktop if it also has a mouse. Not sure why someone would have this use case though. - if ((!hasTouchCapability && self.options.iconDesktop) || (hasTouchCapability && self.options.iconTouch)) { + if ((!deviceHasTouchCapability && self.options.iconDesktop) || (deviceHasTouchCapability && self.options.iconTouch)) { // TODO : the tooltip should be automatically be given an absolute position to be near the origin. Otherwise, when the origin is floating or what, it's going to be nowhere near it and disturb the position flow of the page elements. It will imply that the icon also detects when its origin moves, to follow it : not trivial. // Until it's done, the icon feature does not really make sense since the user still has most of the work to do by himself @@ -115,8 +127,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI // if the icon provided is in the form of a string if(typeof self.options.icon === 'string'){ // wrap it in a span with the icon class - self.$elProxy = $(''); - self.$elProxy.append(self.options.icon); + self.$elProxy = $(''); + self.$elProxy.text(self.options.icon); } // if it is an object (sensible choice) else { @@ -131,205 +143,271 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI self.$elProxy = self.$el; } - // just in case the device ever triggers touch events, add a touch handler that will launch the tooltip. Right after we'll bind the mouse events, they'll just never be used if there is no mouse on the system. - // informative note about device which have touch capacity : if self.options.touchDevices is false, tooltips will not be shown because of touch events. However the plugin itself has been initialized, thus preventing the native "title" tooltips to show. It is assumed that you would not want that anyway. - if (self.options.touchDevices && hasTouchCapability && ((self.options.trigger == 'click') || (self.options.trigger == 'hover'))) { - self.$elProxy.on('touchstart.tooltipster', function() { - self.showTooltip(); - }); - } - - // if hover events are set to show and hide the tooltip, attach those events respectively + // for 'click' and 'hover' triggers : bind on events to open the tooltip. Closing is now handled in showTooltipNow() because of its bindings. + // Notes about touch events : + // - mouseenter, mouseleave and clicks happen even on pure touch devices because they are emulated. deviceIsPureTouch() is a simple attempt to detect them. + // - on hybrid devices, we do not prevent touch gesture from opening tooltips. It would be too complex to differentiate real mouse events from emulated ones. + // - we check deviceIsPureTouch() at each event rather than prior to binding because the situation may change during browsing if (self.options.trigger == 'hover') { - self.$elProxy.on('mouseenter.tooltipster', function() { - self.showTooltip(); - }); - // if this is an interactive tooltip, delay getting rid of the tooltip right away so you have a chance to hover on the tooltip - if (self.options.interactive) { - self.$elProxy.on('mouseleave.tooltipster', function() { - - var keepAlive = false; - - if (self.$tooltip) { - self.$tooltip.mouseenter(function() { - keepAlive = true; - }); - self.$tooltip.mouseleave(function() { - keepAlive = false; - }); - - var tolerance = setTimeout(function() { - - if (keepAlive) { - if (self.options.interactiveAutoClose) { - - self.$tooltip.mouseleave(function(e) { - var $target = $(e.target); - - if ($target.parents('.tooltipster-base').length === 0 || $target.hasClass('tooltipster-base')) { - self.hideTooltip(); - } - - else { - $target.on('mouseleave', function(e) { - self.hideTooltip(); - }); - } - }); - } - } - else { - self.hideTooltip(); - } - }, self.options.interactiveTolerance); + // these binding are for mouse interaction only + self.$elProxy + .on('mouseenter.'+ self.namespace, function() { + if (!deviceIsPureTouch() || self.options.touchDevices) { + self.mouseIsOverProxy = true; + self.showTooltip(); } - else { - self.hideTooltip(); + }) + .on('mouseleave.'+ self.namespace, function() { + if (!deviceIsPureTouch() || self.options.touchDevices) { + self.mouseIsOverProxy = false; } }); - } - // if this is a dumb tooltip, just get rid of it on mouseleave - else { - self.$elProxy.on('mouseleave.tooltipster', function() { - self.hideTooltip(); + + // for touch interaction only + if (deviceHasTouchCapability && self.options.touchDevices) { + + // for touch devices, we immediately display the tooltip because we cannot rely on mouseleave to handle the delay + self.$elProxy.on('touchstart.'+ self.namespace, function() { + self.showTooltipNow(); }); } } - // if click events are set to show and hide the tooltip, attach those events respectively else if (self.options.trigger == 'click') { - self.$elProxy.on('click.tooltipster', function() { - if (!self.$tooltip) { + + // note : for touch devices, we do not bind on touchstart, we only rely on the emulated clicks (triggered by taps) + self.$elProxy.on('click.'+ self.namespace, function() { + if (!deviceIsPureTouch() || self.options.touchDevices) { self.showTooltip(); } - else { - self.hideTooltip(); - } }); } } }, - showTooltip: function(options) { + // this function will schedule the opening of the tooltip after the delay, if there is one + showTooltip: function() { var self = this; - // continue if this tooltip is enabled and has any content, otherwise just ignore it completely - if (!self.$elProxy.hasClass('tooltipster-disable') && self.content !== null) { - - // if we only want one tooltip open at a time, close all tooltips currently open and not already dying - if(self.options.onlyOne){ - $('.tooltipstered').not(self.$el).not('.tooltipster-dying') - .addClass('tooltipster-kill') - // hide using the object public method - [pluginName]('hide'); - } + if (self.status != 'shown' && self.status != 'appearing') { - //get rid of any appearance effect that might be queued or disappearance timer that might be set - self.$elProxy.clearQueue(); - clearTimeout(self.timer); - self.timer = null; - - // delay the showing of the tooltip according to the delay time, if there is one - if(self.options.delay > 0) self.$elProxy.delay(self.options.delay); + if (self.options.delay) { + self.timerShow = setTimeout(function(){ + + // for hover trigger, we check if the mouse is still over the proxy, otherwise we do not show anything + if (self.options.trigger == 'click' || (self.options.trigger == 'hover' && self.mouseIsOverProxy)) { + self.showTooltipNow(); + } + }, self.options.delay); + } + else self.showTooltipNow(); + } + }, + + // this function will open the tooltip right away + showTooltipNow: function() { + + var self = this; + + //get rid of any appearance timer + clearTimeout(self.timerShow); + self.timerShow = null; + clearTimeout(self.timerHide); + self.timerHide = null; + + // continue only if the tooltip is enabled and has any content + if (self.enabled && self.content !== null) { - self.$elProxy.queue(function() { + // if we only want one tooltip open at a time, close all auto-closing tooltips currently open and not already disappearing + if (self.options.onlyOne) { + $('.tooltipstered').not(self.$el).each(function(i,el) { + + // we have to use the public methods here + var $el = $(el), + s = $el[pluginName]('status'), + ac = $el[pluginName]('option', 'autoClose'); + + if (s !== 'hidden' && s !== 'disappearing' && ac) { + $el[pluginName]('hide'); + } + }); + } - // call our custom function before continuing - self.options.functionBefore(self.$elProxy, function() { + // call our custom function before continuing + self.options.functionBefore(self.$elProxy, function() { + + // if this origin already has its tooltip open + if (self.status !== 'hidden') { - // if this origin already has its tooltip open - if (self.$tooltip) { + // the timer (if any) will start (or restart) right now + var extraTime = 0; + + // if it was disappearing, cancel that + if (self.status === 'disappearing') { - // the timer (if any) will start right now - var extraTime = 0; + self.status = 'appearing'; - if (!self.$tooltip.hasClass('tooltipster-kill')) { + if (supportsTransitions()) { - // if it was dying, cancel that - self.$tooltip.removeClass('tooltipster-dying'); + self.$tooltip + .clearQueue() + .removeClass('tooltipster-dying') + .addClass('tooltipster-'+ self.options.animation +'-show'); - if (supportsTransitions()) { - self.$tooltip.clearQueue().addClass('tooltipster-'+ self.options.animation +'-show'); - } - else { - // in case the tooltip was currently fading out, bring it back to life - self.$tooltip.stop().fadeIn(); - } + if(self.options.speed > 0) self.$tooltip.delay(self.options.speed); + + self.$tooltip.queue(function(){ + self.status = 'shown'; + }); + } + else { + // in case the tooltip was currently fading out, bring it back to life + self.$tooltip + .stop() + .fadeIn(function(){ + self.status = 'shown'; + }); } } - // if the tooltip isn't already open, open that sucker up! - else { - - // the timer (if any) will start when the tooltip has fully appeared after its transition - var extraTime = self.options.speed; - - // disable horizontal scrollbar to keep overflowing tooltips from jacking with it and then restore it to its previous value - self.bodyOverflowX = $('body').css('overflow-x'); - $('body').css('overflow-x', 'hidden'); + } + // if the tooltip isn't already open, open that sucker up! + else { + + self.status = 'appearing'; + + // the timer (if any) will start when the tooltip has fully appeared after its transition + var extraTime = self.options.speed; + + // disable horizontal scrollbar to keep overflowing tooltips from jacking with it and then restore it to its previous value + self.bodyOverflowX = $('body').css('overflow-x'); + $('body').css('overflow-x', 'hidden'); + + // get some other settings related to building the tooltip + var animation = 'tooltipster-' + self.options.animation, + animationSpeed = '-webkit-transition-duration: '+ self.options.speed +'ms; -webkit-animation-duration: '+ self.options.speed +'ms; -moz-transition-duration: '+ self.options.speed +'ms; -moz-animation-duration: '+ self.options.speed +'ms; -o-transition-duration: '+ self.options.speed +'ms; -o-animation-duration: '+ self.options.speed +'ms; -ms-transition-duration: '+ self.options.speed +'ms; -ms-animation-duration: '+ self.options.speed +'ms; transition-duration: '+ self.options.speed +'ms; animation-duration: '+ self.options.speed +'ms;', + fixedWidth = self.options.fixedWidth > 0 ? 'width:'+ Math.round(self.options.fixedWidth) +'px;' : '', + maxWidth = self.options.maxWidth > 0 ? 'max-width:'+ Math.round(self.options.maxWidth) +'px;' : '', + pointerEvents = self.options.interactive ? 'pointer-events: auto;' : ''; + + // build the base of our tooltip + self.$tooltip = $('
'); + + // insert the content + self.insertContent(); + + // attach + self.$tooltip.appendTo('body'); + + // do all the crazy calculations and positioning + self.positionTooltip(); + + // call our custom callback since the content of the tooltip is now part of the DOM + self.options.functionReady(self.$el, self.$tooltip); + + // animate in the tooltip + if (supportsTransitions()) { - // get some other settings related to building the tooltip - var theme = self.options.theme, - themeClass = theme.replace('.', ''), - animation = 'tooltipster-' + self.options.animation, - animationSpeed = '-webkit-transition-duration: '+ self.options.speed +'ms; -webkit-animation-duration: '+ self.options.speed +'ms; -moz-transition-duration: '+ self.options.speed +'ms; -moz-animation-duration: '+ self.options.speed +'ms; -o-transition-duration: '+ self.options.speed +'ms; -o-animation-duration: '+ self.options.speed +'ms; -ms-transition-duration: '+ self.options.speed +'ms; -ms-animation-duration: '+ self.options.speed +'ms; transition-duration: '+ self.options.speed +'ms; animation-duration: '+ self.options.speed +'ms;', - fixedWidth = self.options.fixedWidth > 0 ? 'width:'+ Math.round(self.options.fixedWidth) +'px;' : '', - maxWidth = self.options.maxWidth > 0 ? 'max-width:'+ Math.round(self.options.maxWidth) +'px;' : '', - pointerEvents = self.options.interactive ? 'pointer-events: auto;' : ''; + self.$tooltip.addClass(animation + '-show'); - // build the base of our tooltip - self.$tooltip = $('
'); - self.$tooltip - .children() - .append(self.content) - .end() - .appendTo('body'); + if(self.options.speed > 0) self.$tooltip.delay(self.options.speed); - // do all the crazy calculations and positioning - self.positionTooltip(); + self.$tooltip.queue(function(){ + self.status = 'shown'; + }); + } + else { + self.$tooltip.css('display', 'none').fadeIn(self.options.speed, function() { + self.status = 'shown'; + }); + } + + // will check if our tooltip origin is removed while the tooltip is shown + self.setCheckInterval(); + + // auto-close bindings + if (self.options.autoClose) { - // call our custom callback since the content of the tooltip is now part of the DOM - self.options.functionReady(self.$el, self.$tooltip); + // in case a listener is already bound for autoclosing (mouse or touch, hover or click), unbind it first + $('body').off('.'+ self.namespace); - // animate in the tooltip - if (supportsTransitions()) { - self.$tooltip.addClass(animation + '-show'); - } - else { - self.$tooltip.css('display', 'none').fadeIn(self.options.speed); + // here we'll have to set different sets of bindings for both touch and mouse + if (self.options.trigger == 'hover') { + + // if the user touches the body, hide + if (deviceHasTouchCapability) { + // timeout 0 : explanation below in click section + setTimeout(function() { + // we don't want to bind on click here because the initial touchstart event has not yet triggered its click event, which is thus about to happen + $('body').on('touchstart.'+ self.namespace, function() { + self.hideTooltip(); + }); + }, 0); + } + + // if we have to allow interaction + if (self.options.interactive) { + + // touch events inside the tooltip must not close it + if (deviceHasTouchCapability) { + self.$tooltip.on('touchstart.'+ self.namespace, function(event) { + event.stopPropagation(); + }); + } + + // as for mouse interaction, we get rid of the tooltip only after the mouse has spent some time out of it + var tolerance = null; + + self.$elProxy.add(self.$tooltip) + // hide after some time out of the proxy and the tooltip + .on('mouseleave.'+ self.namespace + '-autoClose', function() { + clearTimeout(tolerance); + tolerance = setTimeout(function(){ + self.hideTooltip(); + }, self.options.interactiveTolerance); + }) + // suspend timeout when the mouse is over the proxy or the tooltip + .on('mouseenter.'+ self.namespace + '-autoClose', function() { + clearTimeout(tolerance); + }); + } + // if this is a non-interactive tooltip, get rid of it if the mouse leaves + else { + self.$elProxy.on('mouseleave.'+ self.namespace + '-autoClose', function() { + self.hideTooltip(); + }); + } } - - // check to see if our tooltip origin is removed while the tooltip is alive - self.setCheckInterval(); - - // if this is a touch device, hide the tooltip on body touch - if (self.options.touchDevices && hasTouchCapability) { + // here we'll set the same bindings for both clicks and touch on the body to hide the tooltip + else if(self.options.trigger == 'click'){ - // if interactive, we'll stop the events that were emitted from inside the tooltip + // use a timeout to prevent immediate closing if the method was called on a click event and if options.delay == 0 (because of bubbling) + setTimeout(function() { + $('body').on('click.'+ self.namespace +' touchstart.'+ self.namespace, function() { + self.hideTooltip(); + }); + }, 0); + + // if interactive, we'll stop the events that were emitted from inside the tooltip to stop autoClosing if (self.options.interactive) { - self.$tooltip.on('touchstart', function(event){ + + // note : the touch events will just not be used if the plugin is not enabled on touch devices + self.$tooltip.on('click.'+ self.namespace +' touchstart.'+ self.namespace, function(event) { event.stopPropagation(); }); } - - $('body').one('touchstart.tooltipster', function(event) { - self.hideTooltip(); - }); } } - - // if we have a timer set, let the countdown begin - if (self.options.timer > 0) { - - self.timer = setTimeout(function() { - // clean delete - self.timer = null; - self.hideTooltip(); - }, self.options.timer + extraTime); - } - }); + } - self.$elProxy.dequeue(); + // if we have a timer set, let the countdown begin + if (self.options.timer > 0) { + + self.timerHide = setTimeout(function() { + self.timerHide = null; + self.hideTooltip(); + }, self.options.timer + extraTime); + } }); } }, @@ -365,7 +443,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI } // if this tooltip's origin is removed, remove the tooltip if it's still here - if ($('body').find(self.$el).length === 0 && self.$tooltip) { + if ($('body').find(self.$el).length === 0 && (self.status == 'shown' || self.status == 'appearing')) { self.hideTooltip(); } @@ -376,8 +454,8 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI // if the elProxy has been removed || ($('body').find(self.$elProxy).length === 0) // if the tooltip has been closed - || !self.$tooltip - // if the tooltip has been somehow removed + || self.status == 'hidden' + // if the tooltip has somehow been removed || ($('body').find(self.$tooltip).length === 0) ) { self.cancelCheckInterval(); @@ -395,83 +473,103 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI var self = this; - //TODO : remove this unless there is a good reason behind that - // if the origin has been removed, find all tooltips assigned to death - // if (!tooltipster) { - // tooltipster = $('.tooltipster-dying'); - // } + // get rid of any appearance timeout + clearTimeout(self.timerShow); + self.timerShow = null; + clearTimeout(self.timerHide); + self.timerHide = null; - // clear any possible queues handling delays and such - self.$elProxy.clearQueue(); - - if (self.$tooltip) { + // hide + if (self.status == 'shown' || self.status == 'appearing') { - // just in case we needed to clear a timer - clearTimeout(self.timer); - self.timer = null; - - var animation = 'tooltipster-'+ self.options.animation; + self.status = 'disappearing'; + + var finish = function() { + + self.status = 'hidden'; + + self.$tooltip.remove(); + self.$tooltip = null; + + $('body') + // unbind any auto-closing click/touch listeners + .off('.'+ self.namespace) + .css('overflow-x', self.bodyOverflowX); + + // unbind any auto-closing hover listeners + self.$elProxy.off('.'+ self.namespace + '-autoClose'); + + // finally, call our custom callback function + self.options.functionAfter(self.$elProxy); + }; if (supportsTransitions()) { self.$tooltip .clearQueue() - .removeClass(animation +'-show') + .removeClass('tooltipster-' + self.options.animation + '-show') + // for transitions only .addClass('tooltipster-dying'); if(self.options.speed > 0) self.$tooltip.delay(self.options.speed); - self.$tooltip.queue(function() { - self.$tooltip.remove(); - self.$tooltip = null; - $('body').css('overflow-x', self.bodyOverflowX); - - // finally, call our custom callback function - self.options.functionAfter(self.$elProxy); - }); + self.$tooltip.queue(finish); } else { self.$tooltip - .clearQueue() - .addClass('tooltipster-dying') - .fadeOut(self.options.speed, function() { - self.$tooltip.remove(); - self.$tooltip = null; - $('body').css('overflow-x', self.bodyOverflowX); - - // finally, call our custom callback function - self.options.functionAfter(self.$elProxy); - }); + .stop() + .fadeOut(self.options.speed, finish); } } }, - updateContent: function(content){ + setContent: function(content) { // clone if asked. Cloning the object makes sure that each instance has its own version of the content (in case a same object were provided for several instances) // reminder : typeof null === object - if(typeof content === 'object' && content !== null && this.options.contentCloning){ + if (typeof content === 'object' && content !== null && this.options.contentCloning) { content = content.clone(true); } this.content = content; }, - updateTooltip: function(){ + insertContent: function() { + + var self = this, + $d = this.$tooltip.find('.tooltipster-content'); + + if (typeof self.content === 'string' && !self.options.contentAsHTML) { + $d.text(self.content); + } + else { + $d + .empty() + .append(self.content); + } + }, + + updateTooltip: function(content) { var self = this; - if(self.content !== null){ + // change the content + self.setContent(content); + + if (self.content !== null) { // update the tooltip if it is open - if(self.$tooltip){ - - // set the new content in the tooltip - self.$tooltip.find('.tooltipster-content') - .empty() - .append(self.content); + if (self.status !== 'hidden') { + + // reset the content in the tooltip + self.insertContent(); + + // reposition and resize the tooltip + self.positionTooltip(); // if we want to play a little animation showing the content changed if (self.options.updateAnimation) { + if (supportsTransitions()) { + self.$tooltip.css({ 'width': '', '-webkit-transition': 'all ' + self.options.speed + 'ms, width 0ms, height 0ms, left 0ms, top 0ms', @@ -483,11 +581,15 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI // reset the CSS transitions and finish the change animation setTimeout(function() { - if(self.$tooltip){ + + if(self.status != 'hidden'){ + self.$tooltip.removeClass('tooltipster-content-changing'); + // after the changing animation has completed, reset the CSS transitions setTimeout(function() { - if(self.$tooltip){ + + if(self.status !== 'hidden'){ self.$tooltip.css({ '-webkit-transition': self.options.speed + 'ms', '-moz-transition': self.options.speed + 'ms', @@ -502,15 +604,12 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI } else { self.$tooltip.fadeTo(self.options.speed, 0.5, function() { - if(self.$tooltip){ + if(self.status != 'hidden'){ self.$tooltip.fadeTo(self.options.speed, 1); } }); } } - - // reposition and resize the tooltip - self.positionTooltip(); } } else { @@ -936,8 +1035,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI } // setter method else { - self.updateContent(args[1]); - self.updateTooltip(); + self.updateTooltip(args[1]); break; } @@ -947,19 +1045,19 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI if(self.$el[0] !== self.$elProxy[0]) self.$elProxy.remove(); // old school technique when outerHTML is not supported - var stringifiedContent = $('
').append(self.content).html(); + var stringifiedContent = (typeof self.content === 'string') ? self.content : $('
').append(self.content).html(); self.$el .removeClass('tooltipstered') .attr('title', stringifiedContent) .removeData('tooltipster') - .off('.tooltipster'); + .off('.'+ self.namespace); break; case 'disable': - // hide first, in case the tooltip would not disappear on its own (interactiveAutoClose false) + // hide first, in case the tooltip would not disappear on its own (autoClose false) self.hideTooltip(); - self.$elProxy.addClass('tooltipster-disable'); + self.enabled = false; break; case 'elementIcon': @@ -973,21 +1071,31 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI return false; case 'enable': - self.$elProxy.removeClass('tooltipster-disable'); + self.enabled = true; break; case 'hide': self.hideTooltip(); break; - + + // for internal use only + case 'option': + v = self.options[args[1]]; + break; + case 'reposition': self.positionTooltip(); break; case 'show': - self.showTooltip(); + self.showTooltipNow(); break; + // for internal use use only, not part of the public API + case 'status': + v = self.status; + return false; + default: throw new Error('Unknown method .tooltipster("' + args[0] + '")'); break; @@ -1014,7 +1122,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI }; // quick & dirty compare function (not bijective nor multidimensional) - function areEqual(a,b){ + function areEqual(a,b) { var same = true; $.each(a, function(i, el){ if(typeof b[i] === 'undefined' || a[i] !== b[i]){ @@ -1026,7 +1134,17 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI } // detect if this device can trigger touch events - var hasTouchCapability = !!('ontouchstart' in window); + var deviceHasTouchCapability = !!('ontouchstart' in window); + + // we'll assume the device has no mouse until we detect any mouse movement + var deviceHasMouse = false; + $('body').one('mousemove', function() { + deviceHasMouse = true; + }); + + function deviceIsPureTouch() { + return (!deviceHasMouse && deviceHasTouchCapability); + } // detecting support for CSS transitions function supportsTransitions() { diff --git a/js/jquery.tooltipster.min.js b/js/jquery.tooltipster.min.js index a27423a..4ccdd91 100644 --- a/js/jquery.tooltipster.min.js +++ b/js/jquery.tooltipster.min.js @@ -1 +1 @@ -/* Tooltipster v2.3.0rc3 */;(function(e,t,n){function o(t,n){this.bodyOverflowX;this.checkInterval=null;this.content;this.$el=e(t);this.elProxyPosition;this.$elProxy;this.options=e.extend({},s,n);this.timer=null;this.$tooltip;this.tooltipArrowReposition;this.init()}function u(t,n){var r=true;e.each(t,function(e,i){if(typeof n[e]==="undefined"||t[e]!==n[e]){r=false;return false}});return r}function f(){var e=n.body||n.documentElement,t=e.style,r="transition";if(typeof t[r]=="string"){return true}v=["Moz","Webkit","Khtml","O","ms"],r=r.charAt(0).toUpperCase()+r.substr(1);for(var i=0;i');t.$elProxy.append(t.options.icon)}else{if(t.options.iconCloning)t.$elProxy=t.options.icon.clone(true);else t.$elProxy=t.options.icon}t.$elProxy.insertAfter(t.$el)}else{t.$elProxy=t.$el}if(t.options.touchDevices&&a&&(t.options.trigger=="click"||t.options.trigger=="hover")){t.$elProxy.on("touchstart.tooltipster",function(){t.showTooltip()})}if(t.options.trigger=="hover"){t.$elProxy.on("mouseenter.tooltipster",function(){t.showTooltip()});if(t.options.interactive){t.$elProxy.on("mouseleave.tooltipster",function(){var n=false;if(t.$tooltip){t.$tooltip.mouseenter(function(){n=true});t.$tooltip.mouseleave(function(){n=false});var r=setTimeout(function(){if(n){if(t.options.interactiveAutoClose){t.$tooltip.mouseleave(function(n){var r=e(n.target);if(r.parents(".tooltipster-base").length===0||r.hasClass("tooltipster-base")){t.hideTooltip()}else{r.on("mouseleave",function(e){t.hideTooltip()})}})}}else{t.hideTooltip()}},t.options.interactiveTolerance)}else{t.hideTooltip()}})}else{t.$elProxy.on("mouseleave.tooltipster",function(){t.hideTooltip()})}}else if(t.options.trigger=="click"){t.$elProxy.on("click.tooltipster",function(){if(!t.$tooltip){t.showTooltip()}else{t.hideTooltip()}})}}},showTooltip:function(t){var n=this;if(!n.$elProxy.hasClass("tooltipster-disable")&&n.content!==null){if(n.options.onlyOne){e(".tooltipstered").not(n.$el).not(".tooltipster-dying").addClass("tooltipster-kill")[r]("hide")}n.$elProxy.clearQueue();clearTimeout(n.timer);n.timer=null;if(n.options.delay>0)n.$elProxy.delay(n.options.delay);n.$elProxy.queue(function(){n.options.functionBefore(n.$elProxy,function(){if(n.$tooltip){var t=0;if(!n.$tooltip.hasClass("tooltipster-kill")){n.$tooltip.removeClass("tooltipster-dying");if(f()){n.$tooltip.clearQueue().addClass("tooltipster-"+n.options.animation+"-show")}else{n.$tooltip.stop().fadeIn()}}}else{var t=n.options.speed;n.bodyOverflowX=e("body").css("overflow-x");e("body").css("overflow-x","hidden");var r=n.options.theme,i=r.replace(".",""),s="tooltipster-"+n.options.animation,o="-webkit-transition-duration: "+n.options.speed+"ms; -webkit-animation-duration: "+n.options.speed+"ms; -moz-transition-duration: "+n.options.speed+"ms; -moz-animation-duration: "+n.options.speed+"ms; -o-transition-duration: "+n.options.speed+"ms; -o-animation-duration: "+n.options.speed+"ms; -ms-transition-duration: "+n.options.speed+"ms; -ms-animation-duration: "+n.options.speed+"ms; transition-duration: "+n.options.speed+"ms; animation-duration: "+n.options.speed+"ms;",u=n.options.fixedWidth>0?"width:"+Math.round(n.options.fixedWidth)+"px;":"",l=n.options.maxWidth>0?"max-width:"+Math.round(n.options.maxWidth)+"px;":"",c=n.options.interactive?"pointer-events: auto;":"";n.$tooltip=e('
');n.$tooltip.children().append(n.content).end().appendTo("body");n.positionTooltip();n.options.functionReady(n.$el,n.$tooltip);if(f()){n.$tooltip.addClass(s+"-show")}else{n.$tooltip.css("display","none").fadeIn(n.options.speed)}n.setCheckInterval();if(n.options.touchDevices&&a){if(n.options.interactive){n.$tooltip.on("touchstart",function(e){e.stopPropagation()})}e("body").one("touchstart.tooltipster",function(e){n.hideTooltip()})}}if(n.options.timer>0){n.timer=setTimeout(function(){n.timer=null;n.hideTooltip()},n.options.timer+t)}});n.$elProxy.dequeue()})}},setCheckInterval:function(){var t=this;t.checkInterval=setInterval(function(){if(t.options.positionTracker){var n=t.positionInfo(t.$elProxy),r=false;if(u(n.dimension,t.elProxyPosition.dimension)){if(t.$elProxy.css("position")==="fixed"){if(u(n.position,t.elProxyPosition.position))r=true}else{if(u(n.offset,t.elProxyPosition.offset))r=true}}if(!r){t.positionTooltip()}}if(e("body").find(t.$el).length===0&&t.$tooltip){t.hideTooltip()}if(e("body").find(t.$el).length===0||e("body").find(t.$elProxy).length===0||!t.$tooltip||e("body").find(t.$tooltip).length===0){t.cancelCheckInterval()}},200)},cancelCheckInterval:function(){clearInterval(this.checkInterval);this.checkInterval=null},hideTooltip:function(){var t=this;t.$elProxy.clearQueue();if(t.$tooltip){clearTimeout(t.timer);t.timer=null;var n="tooltipster-"+t.options.animation;if(f()){t.$tooltip.clearQueue().removeClass(n+"-show").addClass("tooltipster-dying");if(t.options.speed>0)t.$tooltip.delay(t.options.speed);t.$tooltip.queue(function(){t.$tooltip.remove();t.$tooltip=null;e("body").css("overflow-x",t.bodyOverflowX);t.options.functionAfter(t.$elProxy)})}else{t.$tooltip.clearQueue().addClass("tooltipster-dying").fadeOut(t.options.speed,function(){t.$tooltip.remove();t.$tooltip=null;e("body").css("overflow-x",t.bodyOverflowX);t.options.functionAfter(t.$elProxy)})}}},updateContent:function(e){if(typeof e==="object"&&e!==null&&this.options.contentCloning){e=e.clone(true)}this.content=e},updateTooltip:function(){var e=this;if(e.content!==null){if(e.$tooltip){e.$tooltip.find(".tooltipster-content").empty().append(e.content);if(e.options.updateAnimation){if(f()){e.$tooltip.css({width:"","-webkit-transition":"all "+e.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-moz-transition":"all "+e.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-o-transition":"all "+e.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-ms-transition":"all "+e.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms",transition:"all "+e.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms"}).addClass("tooltipster-content-changing");setTimeout(function(){if(e.$tooltip){e.$tooltip.removeClass("tooltipster-content-changing");setTimeout(function(){if(e.$tooltip){e.$tooltip.css({"-webkit-transition":e.options.speed+"ms","-moz-transition":e.options.speed+"ms","-o-transition":e.options.speed+"ms","-ms-transition":e.options.speed+"ms",transition:e.options.speed+"ms"})}},e.options.speed)}},e.options.speed)}else{e.$tooltip.fadeTo(e.options.speed,.5,function(){if(e.$tooltip){e.$tooltip.fadeTo(e.options.speed,1)}})}}e.positionTooltip()}}else{e.hideTooltip()}},positionInfo:function(e){return{dimension:{height:e.outerHeight(false),width:e.outerWidth(false)},offset:e.offset(),position:{left:parseInt(e.css("left")),top:parseInt(e.css("top"))}}},positionTooltip:function(){var n=this;if(n.$tooltip){n.$tooltip.css("width","");n.elProxyPosition=n.positionInfo(n.$elProxy);var r=e(t).width(),s=n.elProxyPosition,o=n.$tooltip.outerWidth(false),u=n.$tooltip.innerWidth()+1,a=n.$tooltip.outerHeight(false),f=null;if(n.$elProxy.is("area")){var l=n.$elProxy.attr("shape"),c=n.$elProxy.parent().attr("name"),h=e('img[usemap="#'+c+'"]'),p=h.offset().left,d=h.offset().top,v=n.$elProxy.attr("coords")!==undefined?n.$elProxy.attr("coords").split(","):undefined;if(l=="circle"){var m=parseInt(v[0]),g=parseInt(v[1]),y=parseInt(v[2]);s.dimension.height=y*2;s.dimension.width=y*2;s.offset.top=d+g-y;s.offset.left=p+m-y}else if(l=="rect"){var m=parseInt(v[0]),g=parseInt(v[1]),b=parseInt(v[2]),w=parseInt(v[3]);s.dimension.height=w-g;s.dimension.width=b-m;s.offset.top=d+g;s.offset.left=p+m}else if(l=="poly"){var E=[],S=[],x=0,T=0,N=0,C=0,k="even";for(i=0;iN){N=L;if(i===0){x=N}}if(LC){C=L;if(i==1){T=C}}if(Lr){var s=A-(r+i-o);A=r+i-o;n.tooltipArrowReposition=s}}function B(n,r){if(s.offset.top-e(t).scrollTop()-a-_-12<0&&r.indexOf("top")>-1){P=n}if(s.offset.top+s.dimension.height+a+12+_>e(t).scrollTop()+e(t).height()&&r.indexOf("bottom")>-1){P=n;M=s.offset.top-a-_-12}}if(P=="top"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left+D-j/2;M=s.offset.top-a-_-12;H();B("bottom","top")}if(P=="top-left"){A=s.offset.left+D;M=s.offset.top-a-_-12;H();B("bottom-left","top-left")}if(P=="top-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top-a-_-12;H();B("bottom-right","top-right")}if(P=="bottom"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left-j/2+D;M=s.offset.top+s.dimension.height+_+12;H();B("top","bottom")}if(P=="bottom-left"){A=s.offset.left+D;M=s.offset.top+s.dimension.height+_+12;H();B("top-left","bottom-left")}if(P=="bottom-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top+s.dimension.height+_+12;H();B("top-right","bottom-right")}if(P=="left"){A=s.offset.left-D-o-12;O=s.offset.left+D+s.dimension.width+12;var F=s.offset.top+a-(s.offset.top+n.$elProxy.outerHeight(false));M=s.offset.top-F/2-_;if(A<0&&O+o>r){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=o+A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);A=s.offset.left-D-q-12-I;F=s.offset.top+a-(s.offset.top+n.$elProxy.outerHeight(false));M=s.offset.top-F/2-_}else if(A<0){A=s.offset.left+D+s.dimension.width+12;n.tooltipArrowReposition="left"}}if(P=="right"){A=s.offset.left+D+s.dimension.width+12;O=s.offset.left-D-o-12;var F=s.offset.top+a-(s.offset.top+n.$elProxy.outerHeight(false));M=s.offset.top-F/2-_;if(A+o>r&&O<0){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=r-A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);F=s.offset.top+a-(s.offset.top+n.$elProxy.outerHeight(false));M=s.offset.top-F/2-_}else if(A+o>r){A=s.offset.left-D-o-12;n.tooltipArrowReposition="right"}}if(n.options.arrow){var R="tooltipster-arrow-"+P;if(n.options.arrowColor.length<1){var U=n.$tooltip.css("background-color")}else{var U=n.options.arrowColor}var z=n.tooltipArrowReposition;if(!z){z=""}else if(z=="left"){R="tooltipster-arrow-right";z=""}else if(z=="right"){R="tooltipster-arrow-left";z=""}else{z="left:"+Math.round(z)+"px;"}if(P=="top"||P=="top-left"||P=="top-right"){var W=parseFloat(n.$tooltip.css("border-bottom-width")),X=n.$tooltip.css("border-bottom-color")}else if(P=="bottom"||P=="bottom-left"||P=="bottom-right"){var W=parseFloat(n.$tooltip.css("border-top-width")),X=n.$tooltip.css("border-top-color")}else if(P=="left"){var W=parseFloat(n.$tooltip.css("border-right-width")),X=n.$tooltip.css("border-right-color")}else if(P=="right"){var W=parseFloat(n.$tooltip.css("border-left-width")),X=n.$tooltip.css("border-left-color")}else{var W=parseFloat(n.$tooltip.css("border-bottom-width")),X=n.$tooltip.css("border-bottom-color")}if(W>1){W++}var V="";if(W!==0){var J="",K="border-color: "+X+";";if(R.indexOf("bottom")!==-1){J="margin-top: -"+Math.round(W)+"px;"}else if(R.indexOf("top")!==-1){J="margin-bottom: -"+Math.round(W)+"px;"}else if(R.indexOf("left")!==-1){J="margin-right: -"+Math.round(W)+"px;"}else if(R.indexOf("right")!==-1){J="margin-left: -"+Math.round(W)+"px;"}V=''}n.$tooltip.find(".tooltipster-arrow").remove();var Q='
'+V+'
';n.$tooltip.append(Q)}n.$tooltip.css({top:Math.round(M)+"px",left:Math.round(A)+"px"})}}};e.fn[r]=function(){var t=arguments;if(this.length===0){if(typeof t[0]==="string"){var n=true;switch(t[0]){case"setDefaults":e.extend(s,t[1]);break;default:n=false;break}if(n)return true;else return this}else{return this}}else{if(typeof t[0]==="string"){var r=null;this.each(function(){var n=e(this).data("tooltipster");if(n){switch(t[0]){case"content":case"update":if(typeof t[1]==="undefined"){r=n.content;return false}else{n.updateContent(t[1]);n.updateTooltip();break};case"destroy":n.hideTooltip();if(n.$el[0]!==n.$elProxy[0])n.$elProxy.remove();var i=e("
").append(n.content).html();n.$el.removeClass("tooltipstered").attr("title",i).removeData("tooltipster").off(".tooltipster");break;case"disable":n.hideTooltip();n.$elProxy.addClass("tooltipster-disable");break;case"elementIcon":r=n.$el[0]!==n.$elProxy[0]?n.$elProxy[0]:undefined;return false;case"elementTooltip":r=n.$tooltip?n.$tooltip[0]:undefined;return false;case"enable":n.$elProxy.removeClass("tooltipster-disable");break;case"hide":n.hideTooltip();break;case"reposition":n.positionTooltip();break;case"show":n.showTooltip();break;default:throw new Error('Unknown method .tooltipster("'+t[0]+'")');break}}else{throw new Error("You called Tooltipster's \""+t[0]+'" method on an unitialized element')}});return r!==null?r:this}else{return this.each(function(){if(!e(this).data("tooltipster")){e(this).data("tooltipster",new o(this,t[0]))}})}}};var a=!!("ontouchstart"in t);e(t).on("orientationchange",function(){e(".tooltipstered").each(function(){e(this)[r]("hide")})});e(t).on("scroll resize",function(){e(".tooltipstered").each(function(){e(this)[r]("reposition")})})})(jQuery,window,document); \ No newline at end of file +/* Tooltipster v3.0.0rc1 */;(function(e,t,n){function o(t,n){this.bodyOverflowX;this.checkInterval=null;this.content;this.$el=e(t);this.elProxyPosition;this.$elProxy;this.enabled=true;this.options=e.extend({},s,n);this.mouseIsOverProxy=false;this.namespace="tooltipster-"+Math.round(Math.random()*1e5);this.status="hidden";this.timerHide=null;this.timerShow=null;this.$tooltip;this.tooltipArrowReposition;this.options.iconTheme=this.options.iconTheme.replace(".","");this.options.theme=this.options.theme.replace(".","");this.init()}function u(t,n){var r=true;e.each(t,function(e,i){if(typeof n[e]==="undefined"||t[e]!==n[e]){r=false;return false}});return r}function l(){return!f&&a}function c(){var e=n.body||n.documentElement,t=e.style,r="transition";if(typeof t[r]=="string"){return true}v=["Moz","Webkit","Khtml","O","ms"],r=r.charAt(0).toUpperCase()+r.substr(1);for(var i=0;i');t.$elProxy.text(t.options.icon)}else{if(t.options.iconCloning)t.$elProxy=t.options.icon.clone(true);else t.$elProxy=t.options.icon}t.$elProxy.insertAfter(t.$el)}else{t.$elProxy=t.$el}if(t.options.trigger=="hover"){t.$elProxy.on("mouseenter."+t.namespace,function(){if(!l()||t.options.touchDevices){t.mouseIsOverProxy=true;t.showTooltip()}}).on("mouseleave."+t.namespace,function(){if(!l()||t.options.touchDevices){t.mouseIsOverProxy=false}});if(a&&t.options.touchDevices){t.$elProxy.on("touchstart."+t.namespace,function(){t.showTooltipNow()})}}else if(t.options.trigger=="click"){t.$elProxy.on("click."+t.namespace,function(){if(!l()||t.options.touchDevices){t.showTooltip()}})}}},showTooltip:function(){var e=this;if(e.status!="shown"&&e.status!="appearing"){if(e.options.delay){e.timerShow=setTimeout(function(){if(e.options.trigger=="click"||e.options.trigger=="hover"&&e.mouseIsOverProxy){e.showTooltipNow()}},e.options.delay)}else e.showTooltipNow()}},showTooltipNow:function(){var t=this;clearTimeout(t.timerShow);t.timerShow=null;clearTimeout(t.timerHide);t.timerHide=null;if(t.enabled&&t.content!==null){if(t.options.onlyOne){e(".tooltipstered").not(t.$el).each(function(t,n){var i=e(n),s=i[r]("status"),o=i[r]("option","autoClose");if(s!=="hidden"&&s!=="disappearing"&&o){i[r]("hide")}})}t.options.functionBefore(t.$elProxy,function(){if(t.status!=="hidden"){var n=0;if(t.status==="disappearing"){t.status="appearing";if(c()){t.$tooltip.clearQueue().removeClass("tooltipster-dying").addClass("tooltipster-"+t.options.animation+"-show");if(t.options.speed>0)t.$tooltip.delay(t.options.speed);t.$tooltip.queue(function(){t.status="shown"})}else{t.$tooltip.stop().fadeIn(function(){t.status="shown"})}}}else{t.status="appearing";var n=t.options.speed;t.bodyOverflowX=e("body").css("overflow-x");e("body").css("overflow-x","hidden");var r="tooltipster-"+t.options.animation,i="-webkit-transition-duration: "+t.options.speed+"ms; -webkit-animation-duration: "+t.options.speed+"ms; -moz-transition-duration: "+t.options.speed+"ms; -moz-animation-duration: "+t.options.speed+"ms; -o-transition-duration: "+t.options.speed+"ms; -o-animation-duration: "+t.options.speed+"ms; -ms-transition-duration: "+t.options.speed+"ms; -ms-animation-duration: "+t.options.speed+"ms; transition-duration: "+t.options.speed+"ms; animation-duration: "+t.options.speed+"ms;",s=t.options.fixedWidth>0?"width:"+Math.round(t.options.fixedWidth)+"px;":"",o=t.options.maxWidth>0?"max-width:"+Math.round(t.options.maxWidth)+"px;":"",u=t.options.interactive?"pointer-events: auto;":"";t.$tooltip=e('
');t.insertContent();t.$tooltip.appendTo("body");t.positionTooltip();t.options.functionReady(t.$el,t.$tooltip);if(c()){t.$tooltip.addClass(r+"-show");if(t.options.speed>0)t.$tooltip.delay(t.options.speed);t.$tooltip.queue(function(){t.status="shown"})}else{t.$tooltip.css("display","none").fadeIn(t.options.speed,function(){t.status="shown"})}t.setCheckInterval();if(t.options.autoClose){e("body").off("."+t.namespace);if(t.options.trigger=="hover"){if(a){setTimeout(function(){e("body").on("touchstart."+t.namespace,function(){t.hideTooltip()})},0)}if(t.options.interactive){if(a){t.$tooltip.on("touchstart."+t.namespace,function(e){e.stopPropagation()})}var f=null;t.$elProxy.add(t.$tooltip).on("mouseleave."+t.namespace+"-autoClose",function(){clearTimeout(f);f=setTimeout(function(){t.hideTooltip()},t.options.interactiveTolerance)}).on("mouseenter."+t.namespace+"-autoClose",function(){clearTimeout(f)})}else{t.$elProxy.on("mouseleave."+t.namespace+"-autoClose",function(){t.hideTooltip()})}}else if(t.options.trigger=="click"){setTimeout(function(){e("body").on("click."+t.namespace+" touchstart."+t.namespace,function(){t.hideTooltip()})},0);if(t.options.interactive){t.$tooltip.on("click."+t.namespace+" touchstart."+t.namespace,function(e){e.stopPropagation()})}}}}if(t.options.timer>0){t.timerHide=setTimeout(function(){t.timerHide=null;t.hideTooltip()},t.options.timer+n)}})}},setCheckInterval:function(){var t=this;t.checkInterval=setInterval(function(){if(t.options.positionTracker){var n=t.positionInfo(t.$elProxy),r=false;if(u(n.dimension,t.elProxyPosition.dimension)){if(t.$elProxy.css("position")==="fixed"){if(u(n.position,t.elProxyPosition.position))r=true}else{if(u(n.offset,t.elProxyPosition.offset))r=true}}if(!r){t.positionTooltip()}}if(e("body").find(t.$el).length===0&&(t.status=="shown"||t.status=="appearing")){t.hideTooltip()}if(e("body").find(t.$el).length===0||e("body").find(t.$elProxy).length===0||t.status=="hidden"||e("body").find(t.$tooltip).length===0){t.cancelCheckInterval()}},200)},cancelCheckInterval:function(){clearInterval(this.checkInterval);this.checkInterval=null},hideTooltip:function(){var t=this;clearTimeout(t.timerShow);t.timerShow=null;clearTimeout(t.timerHide);t.timerHide=null;if(t.status=="shown"||t.status=="appearing"){t.status="disappearing";var n=function(){t.status="hidden";t.$tooltip.remove();t.$tooltip=null;e("body").off("."+t.namespace).css("overflow-x",t.bodyOverflowX);t.$elProxy.off("."+t.namespace+"-autoClose");t.options.functionAfter(t.$elProxy)};if(c()){t.$tooltip.clearQueue().removeClass("tooltipster-"+t.options.animation+"-show").addClass("tooltipster-dying");if(t.options.speed>0)t.$tooltip.delay(t.options.speed);t.$tooltip.queue(n)}else{t.$tooltip.stop().fadeOut(t.options.speed,n)}}},setContent:function(e){if(typeof e==="object"&&e!==null&&this.options.contentCloning){e=e.clone(true)}this.content=e},insertContent:function(){var e=this,t=this.$tooltip.find(".tooltipster-content");if(typeof e.content==="string"&&!e.options.contentAsHTML){t.text(e.content)}else{t.empty().append(e.content)}},updateTooltip:function(e){var t=this;t.setContent(e);if(t.content!==null){if(t.status!=="hidden"){t.insertContent();t.positionTooltip();if(t.options.updateAnimation){if(c()){t.$tooltip.css({width:"","-webkit-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-moz-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-o-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms","-ms-transition":"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms",transition:"all "+t.options.speed+"ms, width 0ms, height 0ms, left 0ms, top 0ms"}).addClass("tooltipster-content-changing");setTimeout(function(){if(t.status!="hidden"){t.$tooltip.removeClass("tooltipster-content-changing");setTimeout(function(){if(t.status!=="hidden"){t.$tooltip.css({"-webkit-transition":t.options.speed+"ms","-moz-transition":t.options.speed+"ms","-o-transition":t.options.speed+"ms","-ms-transition":t.options.speed+"ms",transition:t.options.speed+"ms"})}},t.options.speed)}},t.options.speed)}else{t.$tooltip.fadeTo(t.options.speed,.5,function(){if(t.status!="hidden"){t.$tooltip.fadeTo(t.options.speed,1)}})}}}}else{t.hideTooltip()}},positionInfo:function(e){return{dimension:{height:e.outerHeight(false),width:e.outerWidth(false)},offset:e.offset(),position:{left:parseInt(e.css("left")),top:parseInt(e.css("top"))}}},positionTooltip:function(){var n=this;if(n.$tooltip){n.$tooltip.css("width","");n.elProxyPosition=n.positionInfo(n.$elProxy);var r=e(t).width(),s=n.elProxyPosition,o=n.$tooltip.outerWidth(false),u=n.$tooltip.innerWidth()+1,a=n.$tooltip.outerHeight(false),f=null;if(n.$elProxy.is("area")){var l=n.$elProxy.attr("shape"),c=n.$elProxy.parent().attr("name"),h=e('img[usemap="#'+c+'"]'),p=h.offset().left,d=h.offset().top,v=n.$elProxy.attr("coords")!==undefined?n.$elProxy.attr("coords").split(","):undefined;if(l=="circle"){var m=parseInt(v[0]),g=parseInt(v[1]),y=parseInt(v[2]);s.dimension.height=y*2;s.dimension.width=y*2;s.offset.top=d+g-y;s.offset.left=p+m-y}else if(l=="rect"){var m=parseInt(v[0]),g=parseInt(v[1]),b=parseInt(v[2]),w=parseInt(v[3]);s.dimension.height=w-g;s.dimension.width=b-m;s.offset.top=d+g;s.offset.left=p+m}else if(l=="poly"){var E=[],S=[],x=0,T=0,N=0,C=0,k="even";for(i=0;iN){N=L;if(i===0){x=N}}if(LC){C=L;if(i==1){T=C}}if(Lr){var s=A-(r+i-o);A=r+i-o;n.tooltipArrowReposition=s}}function B(n,r){if(s.offset.top-e(t).scrollTop()-a-_-12<0&&r.indexOf("top")>-1){P=n}if(s.offset.top+s.dimension.height+a+12+_>e(t).scrollTop()+e(t).height()&&r.indexOf("bottom")>-1){P=n;M=s.offset.top-a-_-12}}if(P=="top"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left+D-j/2;M=s.offset.top-a-_-12;H();B("bottom","top")}if(P=="top-left"){A=s.offset.left+D;M=s.offset.top-a-_-12;H();B("bottom-left","top-left")}if(P=="top-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top-a-_-12;H();B("bottom-right","top-right")}if(P=="bottom"){var j=s.offset.left+o-(s.offset.left+s.dimension.width);A=s.offset.left-j/2+D;M=s.offset.top+s.dimension.height+_+12;H();B("top","bottom")}if(P=="bottom-left"){A=s.offset.left+D;M=s.offset.top+s.dimension.height+_+12;H();B("top-left","bottom-left")}if(P=="bottom-right"){A=s.offset.left+s.dimension.width+D-o;M=s.offset.top+s.dimension.height+_+12;H();B("top-right","bottom-right")}if(P=="left"){A=s.offset.left-D-o-12;O=s.offset.left+D+s.dimension.width+12;var F=s.offset.top+a-(s.offset.top+n.$elProxy.outerHeight(false));M=s.offset.top-F/2-_;if(A<0&&O+o>r){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=o+A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);A=s.offset.left-D-q-12-I;F=s.offset.top+a-(s.offset.top+n.$elProxy.outerHeight(false));M=s.offset.top-F/2-_}else if(A<0){A=s.offset.left+D+s.dimension.width+12;n.tooltipArrowReposition="left"}}if(P=="right"){A=s.offset.left+D+s.dimension.width+12;O=s.offset.left-D-o-12;var F=s.offset.top+a-(s.offset.top+n.$elProxy.outerHeight(false));M=s.offset.top-F/2-_;if(A+o>r&&O<0){var I=parseFloat(n.$tooltip.css("border-width"))*2,q=r-A-I;n.$tooltip.css("width",q+"px");a=n.$tooltip.outerHeight(false);F=s.offset.top+a-(s.offset.top+n.$elProxy.outerHeight(false));M=s.offset.top-F/2-_}else if(A+o>r){A=s.offset.left-D-o-12;n.tooltipArrowReposition="right"}}if(n.options.arrow){var R="tooltipster-arrow-"+P;if(n.options.arrowColor.length<1){var U=n.$tooltip.css("background-color")}else{var U=n.options.arrowColor}var z=n.tooltipArrowReposition;if(!z){z=""}else if(z=="left"){R="tooltipster-arrow-right";z=""}else if(z=="right"){R="tooltipster-arrow-left";z=""}else{z="left:"+Math.round(z)+"px;"}if(P=="top"||P=="top-left"||P=="top-right"){var W=parseFloat(n.$tooltip.css("border-bottom-width")),X=n.$tooltip.css("border-bottom-color")}else if(P=="bottom"||P=="bottom-left"||P=="bottom-right"){var W=parseFloat(n.$tooltip.css("border-top-width")),X=n.$tooltip.css("border-top-color")}else if(P=="left"){var W=parseFloat(n.$tooltip.css("border-right-width")),X=n.$tooltip.css("border-right-color")}else if(P=="right"){var W=parseFloat(n.$tooltip.css("border-left-width")),X=n.$tooltip.css("border-left-color")}else{var W=parseFloat(n.$tooltip.css("border-bottom-width")),X=n.$tooltip.css("border-bottom-color")}if(W>1){W++}var V="";if(W!==0){var J="",K="border-color: "+X+";";if(R.indexOf("bottom")!==-1){J="margin-top: -"+Math.round(W)+"px;"}else if(R.indexOf("top")!==-1){J="margin-bottom: -"+Math.round(W)+"px;"}else if(R.indexOf("left")!==-1){J="margin-right: -"+Math.round(W)+"px;"}else if(R.indexOf("right")!==-1){J="margin-left: -"+Math.round(W)+"px;"}V=''}n.$tooltip.find(".tooltipster-arrow").remove();var Q='
'+V+'
';n.$tooltip.append(Q)}n.$tooltip.css({top:Math.round(M)+"px",left:Math.round(A)+"px"})}}};e.fn[r]=function(){var t=arguments;if(this.length===0){if(typeof t[0]==="string"){var n=true;switch(t[0]){case"setDefaults":e.extend(s,t[1]);break;default:n=false;break}if(n)return true;else return this}else{return this}}else{if(typeof t[0]==="string"){var r=null;this.each(function(){var n=e(this).data("tooltipster");if(n){switch(t[0]){case"content":case"update":if(typeof t[1]==="undefined"){r=n.content;return false}else{n.updateTooltip(t[1]);break};case"destroy":n.hideTooltip();if(n.$el[0]!==n.$elProxy[0])n.$elProxy.remove();var i=typeof n.content==="string"?n.content:e("
").append(n.content).html();n.$el.removeClass("tooltipstered").attr("title",i).removeData("tooltipster").off("."+n.namespace);break;case"disable":n.hideTooltip();n.enabled=false;break;case"elementIcon":r=n.$el[0]!==n.$elProxy[0]?n.$elProxy[0]:undefined;return false;case"elementTooltip":r=n.$tooltip?n.$tooltip[0]:undefined;return false;case"enable":n.enabled=true;break;case"hide":n.hideTooltip();break;case"option":r=n.options[t[1]];break;case"reposition":n.positionTooltip();break;case"show":n.showTooltipNow();break;case"status":r=n.status;return false;default:throw new Error('Unknown method .tooltipster("'+t[0]+'")');break}}else{throw new Error("You called Tooltipster's \""+t[0]+'" method on an unitialized element')}});return r!==null?r:this}else{return this.each(function(){if(!e(this).data("tooltipster")){e(this).data("tooltipster",new o(this,t[0]))}})}}};var a=!!("ontouchstart"in t);var f=false;e("body").one("mousemove",function(){f=true});e(t).on("orientationchange",function(){e(".tooltipstered").each(function(){e(this)[r]("hide")})});e(t).on("scroll resize",function(){e(".tooltipstered").each(function(){e(this)[r]("reposition")})})})(jQuery,window,document); \ No newline at end of file diff --git a/tooltipster.jquery.json b/tooltipster.jquery.json index 324050d..212df9e 100644 --- a/tooltipster.jquery.json +++ b/tooltipster.jquery.json @@ -5,7 +5,7 @@ "keywords": [ "tooltip" ], - "version": "2.3.0", + "version": "3.0.0", "author": { "name": "Caleb Jacob", "url": "http://calebjacob.com/" @@ -23,9 +23,9 @@ "url": "http://opensource.org/licenses/MIT" } ], - "homepage": "http://calebjacob.com/tooltipster/", - "docs": "http://calebjacob.com/tooltipster/#getting-started", + "homepage": "https://github.com/iamceege/tooltipster", + "docs": "http://iamceege.github.io/tooltipster", "dependencies": { - "jquery": ">=1.4" + "jquery": ">=1.7" } } \ No newline at end of file