
Security News
How Enterprise Security Is Adapting to AI-Accelerated Threats
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.
@fengyuanchen/tooltip
Advanced tools
A simple jQuery tooltip plugin.
dist/
├── tooltip.css (2 KB)
├── tooltip.min.css (2 KB)
├── tooltip.js (9 KB)
└── tooltip.min.js (4 KB)
Three quick start options are available:
git clone https://github.com/fengyuanchen/tooltip.git.npm install @fengyuanchen/tooltip.Include files:
<script src="/path/to/jquery.js"></script><!-- jQuery is required -->
<link href="/path/to/tooltip.css" rel="stylesheet">
<script src="/path/to/tooltip.js"></script>
Initialize with $.fn.tooltip method.
// With option
$('body').tooltip({
autoshow: true,
content: 'Hello, world!'
});
// With method
$('body').tooltip('show', 'Hello, world!');
// Shortcut
$('body').tooltip('Hello, world!');
// Set tooltip options
$().tooltip(options);
// Change the global default options
$.fn.tooltip.setDefaults(options);
BooleantrueHide the tooltip automatically when timeout. requires duration option to be set.
BooleantrueShow the tooltip automatically when initialize. requires content option to be set.
String''Tooltip content
BooleanfalseShow countdown view. requires duration option to be set.
BooleanfalseAllow to dismiss the tooltip by click an attached close button before it is closed automatically.
Number3000Define the time of the tooltip showing (3 seconds by default).
BooleantrueFix the tooltip (Only available for body element).
Number10Offset of the tooltip from its parent.
String'center top''left top', 'center top', 'right top',
'left middle', 'center middle', 'right middle',
'left bottom', 'center bottom', 'right bottom'Position of the tooltip (horizontal and vertical)
String'default''default', 'primary', 'success', 'info', 'warning', 'danger'Style of the tooltip
Number1024Z-index of the tooltip.
$().tooltip('method', argument1, , argument2, ..., argumentN)
StringShow the tooltip with new content.
$().tooltip('show', 'Hello, world!');
$().tooltip('show', 'Hello, world!', 'primary');
$().tooltip('show', 'Hello, world!', {
style: 'primary',
zIndex: 2048
});
Shortcut: $().tooltip(content, options)
show method$().tooltip('Hello, world!', 'primary');
Hide the tooltip.
Destroy the tooltip.
This event fires immediately when the show instance method is called.
This event is fired when the tooltip has been made visible to the user (will wait for CSS transitions to complete).
This event is fired immediately when the hide instance method has been called.
This event is fired when the tooltip has finished being hidden from the user (will wait for CSS transitions to complete).
If you have to use other plugin with the same namespace, just call the $.fn.tooltip.noConflict method to revert to it.
<script src="other-plugin.js"></script>
<script src="tooltip.js"></script>
<script>
$.fn.tooltip.noConflict();
// Code that uses other plugin's "$().tooltip" can follow here.
</script>
As a jQuery plugin, you also need to see the jQuery Browser Support.
Released under the MIT license.
FAQs
A simple jQuery tooltip plugin.
The npm package @fengyuanchen/tooltip receives a total of 2,955 weekly downloads. As such, @fengyuanchen/tooltip popularity was classified as popular.
We found that @fengyuanchen/tooltip demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.