Chatango Remove offscreen Images

Removes images that are offscreen once per minute

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

// ==UserScript==
// @name        Chatango Remove offscreen Images
// @namespace   Chatango Remove offscreen Images
// @description Removes images that are offscreen once per minute
// @include     *//st.chatango.com/*
// @version     1.08
// @grant       none
// @require     https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js
// @require     https://greasyforks.org/scripts/7702-jquery-viewport-checker/code/jQuery-viewport-checker.js?version=33495
// ==/UserScript==


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

function removeinvis(){
	$('.thumb, .thumb-popup, .video-thumb, .msg-bg, .smiley').each(
		function(index, el){
			$(el).viewportChecker({
				repeat:true,callbackFunction: function(elem, action){
					if(action=="remove")
						$(elem).remove();
				}
			});
		}
	);
}

function removeold(){
	x=$('.msg').length;
	if(x>50){
		$('.msg').slice(0,x-50).remove();
	}
}
长期地址
遇到问题?请前往 GitHub 提 Issues。