Skip to content

Instantly share code, notes, and snippets.

@Phr33d0m
Last active July 27, 2023 03:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Phr33d0m/4fb2bf35f5885fd6f49879a442d4bb41 to your computer and use it in GitHub Desktop.
Save Phr33d0m/4fb2bf35f5885fd6f49879a442d4bb41 to your computer and use it in GitHub Desktop.
Fix adding styles
const stylez = `<style>
.masinfo {z-index: 1 !important}
.masinfo span {display: inline-block !important}
.masinfo .ficha div {line-height: 12px !important}
.masinfo .ficha .rapido {background-size: 100%; top: 2px; width: 10px; height: 10px;}
</style>`;
document.head.insertAdjacentHTML("beforeend", stylez)
var jqCjs = jQuery.noConflict();
jqCjs('.ttitle').hover(function() {
var ttitle = jqCjs(this);
var link = ttitle.children('a').length === 2
? ttitle.children('a')[1].href
: ttitle.children('a')[0].href;
// If there's no masinfo element, add it
if (!ttitle.find('.masinfo').length) {
ttitle.append('<span class="masinfo"></span>');
}
var masinfo = jqCjs(ttitle.find('.masinfo')[0]);
// If there's no file loaded yet, load it
if (!masinfo.find('.ficha')[0]) {
masinfo.text('Cargando...');
masinfo.load(link + ' .ficha');
}
}, function() {});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment