{"_id":"@fengyuanchen/tooltip","_rev":"3227672","name":"@fengyuanchen/tooltip","description":"A simple jQuery tooltip plugin.","dist-tags":{"latest":"0.0.2"},"maintainers":[{"name":"fengyuanchen","email":""}],"time":{"modified":"2024-03-21T07:36:16.000Z","created":"2015-08-09T09:47:32.210Z","0.0.2":"2015-08-09T09:47:32.210Z"},"users":{},"author":{"name":"Fengyuan Chen","url":"https://github.com/fengyuanchen"},"repository":{"type":"git","url":"git+https://github.com/fengyuanchen/tooltip.git"},"versions":{"0.0.2":{"name":"@fengyuanchen/tooltip","description":"A simple jQuery tooltip plugin.","version":"0.0.2","main":"dist/tooltip.js","keywords":["tooltip","jquery","plugin","html","css","javascript","front-end","web","development"],"author":{"name":"Fengyuan Chen","url":"https://github.com/fengyuanchen"},"homepage":"https://github.com/fengyuanchen/tooltip","repository":{"type":"git","url":"git+https://github.com/fengyuanchen/tooltip.git"},"bugs":{"url":"https://github.com/fengyuanchen/tooltip/issues"},"license":"MIT","dependencies":{"jquery":">= 1.9.1"},"devDependencies":{"gulp":"^3.9","gulp-autoprefixer":"^2.3.1","gulp-csscomb":"^3.0.3","gulp-csslint":"^0.1.5","gulp-jscs":"^1.5.1","gulp-jshint":"^1.11.0","gulp-load-plugins":"^0.10.0","gulp-minify-css":"^1.1.6","gulp-rename":"^1.2.0","gulp-replace":"^0.5.3","gulp-uglify":"^1.1.0"},"gitHead":"02a0425060da177f42296ffa62abc6c45a331f42","_id":"@fengyuanchen/tooltip@0.0.2","scripts":{},"_shasum":"77296e616aa7617738456927447968221ee6cd47","_from":".","_npmVersion":"2.8.3","_nodeVersion":"0.12.2","_npmUser":{"name":"fengyuanchen","email":"cfy.org@gmail.com"},"dist":{"shasum":"77296e616aa7617738456927447968221ee6cd47","size":263007,"noattachment":false,"key":"/@fengyuanchen/tooltip/-/@fengyuanchen/tooltip-0.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/@fengyuanchen/tooltip/download/@fengyuanchen/tooltip-0.0.2.tgz"},"maintainers":[{"name":"fengyuanchen","email":""}],"directories":{},"deprecated":"No longer maintainted.","_cnpmcore_publish_time":"2021-12-20T13:01:17.666Z","publish_time":1439113652210,"_cnpm_publish_time":1439113652210}},"readme":"# [Tooltip](https://github.com/fengyuanchen/tooltip)\n\n> A simple jQuery tooltip plugin.\n\n- [Demo](http://fengyuanchen.github.io/tooltip)\n\n\n## Main\n\n```\ndist/\n├── tooltip.css     (2 KB)\n├── tooltip.min.css (2 KB)\n├── tooltip.js      (9 KB)\n└── tooltip.min.js  (4 KB)\n```\n\n\n\n## Getting started\n\n### Quick start\n\nThree quick start options are available:\n\n- [Download the latest release](https://github.com/fengyuanchen/tooltip/archive/master.zip).\n- Clone the repository: `git clone https://github.com/fengyuanchen/tooltip.git`.\n- Install with [NPM](http://npmjs.org): `npm install @fengyuanchen/tooltip`.\n\n\n\n### Installation\n\nInclude files:\n\n```html\n<script src=\"/path/to/jquery.js\"></script><!-- jQuery is required -->\n<link  href=\"/path/to/tooltip.css\" rel=\"stylesheet\">\n<script src=\"/path/to/tooltip.js\"></script>\n```\n\n\n### Usage\n\nInitialize with `$.fn.tooltip` method.\n\n```js\n// With option\n$('body').tooltip({\n  autoshow: true,\n  content: 'Hello, world!'\n});\n\n// With method\n$('body').tooltip('show', 'Hello, world!');\n\n// Shortcut\n$('body').tooltip('Hello, world!');\n```\n\n\n## Options\n\n```js\n// Set tooltip options\n$().tooltip(options);\n\n// Change the global default options\n$.fn.tooltip.setDefaults(options);\n```\n\n\n### autohide\n\n- Type: `Boolean`\n- Default: `true`\n\nHide the tooltip automatically when timeout. requires `duration` option to be set.\n\n\n### autoshow\n\n- Type: `Boolean`\n- Default: `true`\n\nShow the tooltip automatically when initialize. requires `content` option to be set.\n\n\n### content\n\n- Type: `String`\n- Default: `''`\n\nTooltip content\n\n\n### countdown\n\n- Type: `Boolean`\n- Default: `false`\n\nShow countdown view. requires `duration` option to be set.\n\n\n### dismissible\n\n- Type: `Boolean`\n- Default: `false`\n\nAllow to dismiss the tooltip by click an attached close button before it is closed automatically.\n\n\n### duration\n\n- Type: `Number`\n- Default: `3000`\n\nDefine the time of the tooltip showing (3 seconds by default).\n\n\n### fixed\n\n- Type: `Boolean`\n- Default: `true`\n\nFix the tooltip (Only available for `body` element).\n\n\n### offset\n\n- Type: `Number`\n- Default: `10`\n\nOffset of the tooltip from its parent.\n\n\n### position\n\n- Type: `String`\n- Default: `'center top'`\n- Options:\n    `'left top'`,    `'center top'`,    `'right top'`,\n    `'left middle'`, `'center middle'`, `'right middle'`,\n    `'left bottom'`, `'center bottom'`, `'right bottom'`\n\nPosition of the tooltip (horizontal and vertical)\n\n\n### style\n\n- Type: `String`\n- Default: `'default'`\n- Options: `'default'`, `'primary'`, `'success'`, `'info'`, `'warning'`, `'danger'`\n\nStyle of the tooltip\n\n\n### zIndex\n\n- Type: `Number`\n- Default: `1024`\n\nZ-index of the tooltip.\n\n\n\n## Methods\n\n\n```js\n$().tooltip('method', argument1, , argument2, ..., argumentN)\n```\n\n\n### show([content[, options]])\n\n- **content** (optional):\n  - Type: `String`\n  - Tooltip's [content](#content)\n- **options** (optional):\n  - Type: `String` or `Object`\n  - Tooltip's [style](#style) or tooltip's [options](#options)\n\nShow the tooltip with new content.\n\n```js\n$().tooltip('show', 'Hello, world!');\n$().tooltip('show', 'Hello, world!', 'primary');\n$().tooltip('show', 'Hello, world!', {\n  style: 'primary',\n  zIndex: 2048\n});\n```\n\n\n**Shortcut:** `$().tooltip(content, options)`\n\n- Only for `show` method\n- The first argument must be a string (not one of the methods)\n\n```js\n$().tooltip('Hello, world!', 'primary');\n```\n\n\n### hide()\n\nHide the tooltip.\n\n\n### destroy()\n\nDestroy the tooltip.\n\n\n\n## Events\n\n\n### show.tooltip\n\nThis event fires immediately when the `show` instance method is called.\n\n\n### shown.tooltip\n\nThis event is fired when the tooltip has been made visible to the user (will wait for CSS transitions to complete).\n\n\n### hide.tooltip\n\nThis event is fired immediately when the hide instance method has been called.\n\n\n### hidden.tooltip\n\nThis event is fired when the tooltip has finished being hidden from the user (will wait for CSS transitions to complete).\n\n\n\n## No conflict\n\nIf you have to use other plugin with the same namespace, just call the `$.fn.tooltip.noConflict` method to revert to it.\n\n```html\n<script src=\"other-plugin.js\"></script>\n<script src=\"tooltip.js\"></script>\n<script>\n  $.fn.tooltip.noConflict();\n  // Code that uses other plugin's \"$().tooltip\" can follow here.\n</script>\n```\n\n\n\n## Browser Support\n\n- Chrome (latest 2)\n- Firefox (latest 2)\n- Internet Explorer 8+\n- Opera (latest 2)\n- Safari (latest 2)\n\nAs a jQuery plugin, you also need to see the [jQuery Browser Support](http://jquery.com/browser-support/).\n\n\n\n## [License](LICENSE.md)\n\nReleased under the [MIT](http://opensource.org/licenses/mit-license.html) license.\n","_attachments":{},"homepage":"https://github.com/fengyuanchen/tooltip","bugs":{"url":"https://github.com/fengyuanchen/tooltip/issues"},"license":"MIT"}