Jump to content

MediaWiki:BibleGet.js: Difference between revisions

no edit summary
No edit summary
No edit summary
Line 19: Line 19:
$bGetTIP = $("div[data-version='"+version+"'][data-ref='"+ref+"']");
$bGetTIP = $("div[data-version='"+version+"'][data-ref='"+ref+"']");
console.log('I found ' + $bGetTIP.length + ' div(s) at the bottom of the page with this bible quote');
console.log('I found ' + $bGetTIP.length + ' div(s) at the bottom of the page with this bible quote');
$bGetTIP.show();
$bGetTIP.removeClass('hidden');
let top = $span.offset().top;
let top = $span.offset().top;
let left = $span.offset().left + $span.outerWidth() + 15;
let left = $span.offset().left + $span.outerWidth() + 15;
Line 36: Line 36:
$bGetTIP = $("div[data-version='"+version+"'][data-ref='"+ref+"']");
$bGetTIP = $("div[data-version='"+version+"'][data-ref='"+ref+"']");
//console.log('I found ' + $bGetTIP.length + ' div(s) at the bottom of the page with this bible quote');
//console.log('I found ' + $bGetTIP.length + ' div(s) at the bottom of the page with this bible quote');
setTimeout(function(){ $bGetTIP.fadeOut('slow') },500);
setTimeout(function(){ $bGetTIP.addClass('hidden'); },500);
});
});
} else {
} else {
Line 52: Line 52:
if(data.hasOwnProperty('html')){
if(data.hasOwnProperty('html')){
let $bGetTIP = $('<div>', {
let $bGetTIP = $('<div>', {
"class": "bibleGetQuote",
"class": "bibleGetQuote hidden",
"data-version": version,
"data-version": version,
"data-ref": ref,
"data-ref": ref,
Line 61: Line 61:
$span.on('mouseenter', function(){
$span.on('mouseenter', function(){
$bGetTIP.show();
$bGetTIP.removeClass('hidden');
let top = $span.offset().top;
let top = $span.offset().top;
let left = $span.offset().left + $span.outerWidth() + 15;
let left = $span.offset().left + $span.outerWidth() + 15;
Line 76: Line 76:
$span.on('mouseleave', function(){
$span.on('mouseleave', function(){
setTimeout(function(){ $bGetTIP.fadeOut('slow') },500);
setTimeout(function(){ $bGetTIP.addClass('hidden'); },500);
});
});
}
}