Chatango Remove Old Messages and more

Removes images that are offscreen once per minute

As of 2015-02-12. See the latest version.

// ==UserScript==
// @name        Chatango Remove Old Messages and more
// @namespace   Chatango Remove offscreen Images
// @description Removes images that are offscreen once per minute
// @include     *//st.chatango.com/*
// @version     1.17
// @grant       none
// @require     https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js
// ==/UserScript==


this.$ = this.jQuery = jQuery.noConflict(true);
//removeinvis();
$("<style type='text/css'> .msg{ overflow-x:hidden; overflow-y:auto;max-height:140px;} p.msg-date { float: right; }</style>").appendTo("head");
//removeold();
setInterval(removeold,300000);

var timeout;
function removeold(){
	x=$('.msg').length;
	if(x>100){
		timeout=100;
		$('.msg').slice(0,x-100).each(function(){
			curslice=this;
			setTimeout(function(){
				height=$(curslice).innerHeight();
				$.when($(curslice).remove()).then(function(){
					$("#OM").css("top", parseInt($("#OM").css("top"))+height+"px");
				});
			}, timeout);
			timeout=timeout+100;
		});
	}
}
长期地址
遇到问题?请前往 GitHub 提 Issues。