Removes images that are offscreen once per minute
当前为
// ==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();
}
}