MediaWiki:BibleGet.js: Difference between revisions
no edit summary
Johnrdorazio (talk | contribs) No edit summary |
Johnrdorazio (talk | contribs) No edit summary |
||
Line 10: | Line 10: | ||
let ref = $(this).attr('data-ref'); | let ref = $(this).attr('data-ref'); | ||
if(bibleQuoteCollection.includes(version+"/"+ref)){ | if(bibleQuoteCollection.includes(version+"/"+ref)){ | ||
//we already have an instance of this bible quote, | //we already have an instance of this bible quote, avoid creating new div | ||
$bGetTIP = $("div[data-version='"+version+"'][data-ref='"+ref+"']"); | |||
$span.on('mouseenter', function(){ | |||
$bGetTIP.show(); | |||
let top = $span.offset().top; | |||
let left = $span.offset().left + $span.outerWidth() + 15; | |||
$bGetTIP.css({"top":top,"left":left}); | |||
}); | |||
/* | |||
$span.on('mousemove', function(){ | |||
let top = $span.offset().top; | |||
let left = $span.offset().left + $span.outerWidth(); | |||
$bGetTIP.css({"top":top,"left":left}); | |||
}); | |||
*/ | |||
$span.on('mouseleave', function(){ | |||
setTimeout(function(){ $bGetTIP.fadeOut('slow') },500); | |||
}); | |||
} else { | } else { | ||
bibleQuoteCollection.push(version+"/"+ref); | bibleQuoteCollection.push(version+"/"+ref); |