MediaWiki:BibleGet.js: differenze tra le versioni

Nessun cambiamento nella dimensione ,  3 anni fa
nessun oggetto della modifica
Nessun oggetto della modifica
Nessun oggetto della modifica
Riga 35: Riga 35:
// then let's just move our div up by that much
// then let's just move our div up by that much
if(!$bGetTIP.hasClass('sticky')){
if(!$bGetTIP.hasClass('sticky')){
if(excessWidth > 0 && excessWidth < rect.x){
console.log('This element was off the right hand side of the screen');
let newLeft;
if($span.offset().left > rect.width){
newLeft = $span.offset().left - rect.width;
} else {
newLeft = $span.offset().left - rect.width / 2; //center it on the span as a last resort!
}
$bGetTIP.css({"left":newLeft});
}
if(excessHeight > 0 && excessHeight < rect.y){
if(excessHeight > 0 && excessHeight < rect.y){
console.log('This element was off the bottom of the screen');
console.log('This element was off the bottom of the screen');
Riga 49: Riga 59:
let newTop = (window.pageYOffset || (document.documentElement || document.body.parentNode || document.body).scrollTop) + 20;
let newTop = (window.pageYOffset || (document.documentElement || document.body.parentNode || document.body).scrollTop) + 20;
$bGetTIP.css({"top":newTop});
$bGetTIP.css({"top":newTop});
}
if(excessWidth > 0 && excessWidth < rect.x){
console.log('This element was off the right hand side of the screen');
let newLeft;
if($span.offset().left > rect.width){
newLeft = $span.offset().left - rect.width;
} else {
newLeft = $span.offset().left - rect.width / 2; //center it on the span as a last resort!
}
$bGetTIP.css({"left":newLeft});
}
}
}
}