Scrolling

This commit is contained in:
genuineparts 2025-06-26 14:52:34 +02:00
parent 7050ecaf56
commit 4b2a0adf29

View file

@ -594,8 +594,7 @@ function inmeta2(){
$('#chatlog').append('Error! Please check your browsers console for the error message.'); $('#chatlog').append('Error! Please check your browsers console for the error message.');
window.onbeforeunload = null; window.onbeforeunload = null;
if(as!=false){ if(as!=false){
var target = $('#chatlog'); $('#chatlog').scrollTop($('#chatlog').prop('scrollHeight'));
target.animate({ scrollTop: target.scrollHeight}, 500 );
} }
} }
socket.onclose = function(){ socket.onclose = function(){
@ -603,8 +602,7 @@ function inmeta2(){
$('#chatlog').append('Disconnected!'); $('#chatlog').append('Disconnected!');
window.onbeforeunload = null; window.onbeforeunload = null;
if(as!=false){ if(as!=false){
var target = $('#chatlog'); $('#chatlog').scrollTop($('#chatlog').prop('scrollHeight'));
target.animate({ scrollTop: target.scrollHeight}, 500 );
} }
} }
@ -612,8 +610,7 @@ function inmeta2(){
$('#chatlog').append('Disconnected with error: '+exception+'!'); $('#chatlog').append('Disconnected with error: '+exception+'!');
window.onbeforeunload = null; window.onbeforeunload = null;
if(as!=false){ if(as!=false){
var target = $('#chatlog'); $('#chatlog').scrollTop($('#chatlog').prop('scrollHeight'));
target.animate({ scrollTop: target.scrollHeight}, 500 );
} }
console.log(exception); console.log(exception);
} }
@ -813,8 +810,7 @@ function inmeta2(){
$('#'+whispt[1]+'_whisper_text').append('<span style=\"color: #585858;\">Du: '+whispt[2]+'</span><br />'); $('#'+whispt[1]+'_whisper_text').append('<span style=\"color: #585858;\">Du: '+whispt[2]+'</span><br />');
$('#'+whispt[1]+'_whisper').dialog('open'); $('#'+whispt[1]+'_whisper').dialog('open');
$('#'+whispt[1]+'_whisper').dialog('moveToTop'); $('#'+whispt[1]+'_whisper').dialog('moveToTop');
var wtarget = $('#'+whisp[1]+'_whisper_text'); $('#'+whisp[1]+'_whisper_text').scrollTop($('#'+whisp[1]+'_whisper_text').prop('scrollHeight'));
$('#'+whisp[1]+'_whisper_text').animate({ scrollTop: wtarget.scrollHeight}, 500 );
}else{ }else{
create_whisper(whispt[1],whispt[2],true); create_whisper(whispt[1],whispt[2],true);
} }
@ -825,8 +821,7 @@ function inmeta2(){
$('#'+whisp[1]+'_whisper_text').append('<span style=\"color: #000000;\">'+whisp[1]+': '+whisp[2]+'</span><br />'); $('#'+whisp[1]+'_whisper_text').append('<span style=\"color: #000000;\">'+whisp[1]+': '+whisp[2]+'</span><br />');
$('#'+whisp[1]+'_whisper').dialog('open'); $('#'+whisp[1]+'_whisper').dialog('open');
$('#'+whisp[1]+'_whisper').dialog('moveToTop'); $('#'+whisp[1]+'_whisper').dialog('moveToTop');
var wtarget = $('#'+whisp[1]+'_whisper_text'); $('#'+whisp[1]+'_whisper_text').scrollTop($('#'+whisp[1]+'_whisper_text').prop('scrollHeight'));
$('#'+whisp[1]+'_whisper_text').animate({ scrollTop: wtarget.scrollHeight}, 500 );
}else{ }else{
create_whisper(whisp[1],whisp[2]); create_whisper(whisp[1],whisp[2]);
} }
@ -842,8 +837,7 @@ function inmeta2(){
} }
$('#chatlog').append(msg); $('#chatlog').append(msg);
if(as!=false){ if(as!=false){
var target = $('#chatlog'); $('#chatlog').scrollTop($('#chatlog').prop('scrollHeight'));
target.animate({ scrollTop: target.scrollHeight}, 500 );
} }
}//End message() }//End message()