Chatango Remove offscreen Images

Removes images that are offscreen once per minute

اعتبارا من 07-02-2015. شاهد أحدث إصدار.

// ==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.14
// @grant       none
// @require     https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js
// @require     https://greasyfork.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:140px;}</style>").appendTo("head");
//removeold();
setInterval(removeold,300000);

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();
				}
			});
		}
	);
}
var timeout;
function removeold(){
	x=$('.msg').length;
	if(x>100){
		timeout=100;
		$('.msg').slice(0,x-100).each(function(){
			var that=this;
			setTimeout(function(){
				$(that).remove();
			}, timeout);
			setTimeout(function(){
				$("#OM").css("top", parseInt($("#OM").css("top"))+$(that).height()+1+"px");
			},timeout-10);
			timeout=timeout+100;
		});
	}
}