Chatango Remove offscreen Images

Removes images that are offscreen once per minute

目前為 2015-02-03 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==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.09
// @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:130px;} </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();
	}
}