Greasy Fork

来自缓存

Greasy Fork is available in English.

电子发烧友直接阅读全文

电子发烧友直接阅读全文并去除头部广告

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @name         电子发烧友直接阅读全文
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  电子发烧友直接阅读全文并去除头部广告
// @author       DC
// @match        http://m.elecfans.com/*
// @grant        none
// @require      https://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js
// @run-at document-end
// ==/UserScript==

(function() {
    'use strict';
    function hideAd() {
        var AdList = document.querySelectorAll('.open_app.flex.open_app_fixed')
        if(AdList instanceof Object && AdList.length>0){
            for(var i=0;i<AdList.length;i++){
                AdList[i].style.display = 'none'
            }
        }
    }

    function hideReadMore(){
        $('.article').removeClass('limit_height').removeClass('limit_height_computer');
        // $('.show_more').parents('.see_more').remove();
        $('.see_more_arc').addClass('hide');
        layer.closeAll()
    }

    setTimeout(()=>{
       hideReadMore()
    }, 1000)

    $(window).scroll(function(){
        var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
        if (scrollTop > 0) {
            hideAd();
        }
    });
})();