Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
tooltipster-htmltitle
Advanced tools
A Tooltipster plugin that lets you easily point out an HTML element to serve as tooltip content.
A Tooltipster plugin that lets you easily point out an HTML element to serve as tooltip content. MIT license.
This plugin doesn't add much to Tooltipster, it's rather meant for beginners who are not comfortable with manipulating their DOM with jQuery and who need the most simple instructions.
Include the plugin file in your page AFTER the Tooltipster bundle file.
<html>
<head>
...
<script type="text/javascript" src="tooltipster/dist/js/tooltipster.bundle.min.js"></script>
<script type="text/javascript" src="tooltipster-htmlTitle/tooltipster-htmlTitle.min.js"></script>
</head>
</html>
You can now set a data-htmltitle
attribute on your origins to point out which HTML element in the page should be used as content for the tooltip.
<span class="tooltip" data-htmltitle="#tooltip_content">This text has a tooltip when you hover over it</span>
<span id="tooltip_content"><img src="image.jpg" /> <b>This is the content of my tooltip!</b></span>
If the selector you provide in the attribute matches several elements, only the first one will be used.
If you have two tooltips that have the same
data-htmltitle
(that is to say, want to both use a single HTML element), don't forget to set thecontentCloning
option to true when you initialize your tooltips.
I suggest you set up your page like this:
HTML:
<span class="tooltip" data-htmltitle="#tooltip_fruit">Cherries</span>
<span class="tooltip" data-htmltitle="#tooltip_fruit">Strawberries</span>
<span class="tooltip" data-htmltitle="#tooltip_vegetable">Carrots</span>
<div id="templates">
<span id="tooltip_fruit"><img src="fruit.jpg" /> <b>These are fruit!</b></span>
<span id="tooltip_vegetable"><img src="vegetable.jpg" /> <b>These are vegetables!</b></span>
</div>
CSS:
#templates {
display: none;
}
Javascript:
$('.tooltip').tooltipster({
contentCloning: true
)};
htmlTitleScope
By default, the plugin will search in the page for an element that matches your selector. If you wish to search in other scope, for example if you maintain your templates somewhere else, you may provide it here.
FAQs
A Tooltipster plugin that lets you easily point out an HTML element to serve as tooltip content.
The npm package tooltipster-htmltitle receives a total of 1 weekly downloads. As such, tooltipster-htmltitle popularity was classified as not popular.
We found that tooltipster-htmltitle 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.