百度背景图不被卡片挡住!

百度,你挡住我看背景图了!

< Feedback on 百度背景图不被卡片挡住!

Review: Good - script works

§
Posted: 23.07.2020
Edited: 23.07.2020

// ==UserScript==
// 进一步删除一些冗余元素
// @name 百度背景图不被卡片挡住!
// @namespace 1312141991@qq.com
// @version 0.4
// @description 百度,你挡住我看背景图了!
// @author 及小路
// @match https://www.baidu.com/
// @grant none
// ==/UserScript==

(function() {

//底部栏位透明
//document.getElementById("bottom_layer").style.backgroundColor="#0000";
document.getElementById("s_top_wrap").style.backgroundColor="#0000";
document.getElementById("bottom_layer").remove();
document.getElementById("s_lm_wrap").remove();
document.getElementById("s_side_wrapper").remove();
document.getElementById("s_lg_img").remove();
//可调部位
var opa = 0;//调整初始透明度,数值在0-10,数字越小透明度越高(0是全透明,10是不透明)

var speed = 0;//调整渐变速度,数值建议在100-500,数字越小,渐变速度越快

//先设置透明度
document.getElementById("s_main").style.opacity=opa/10;
var card_0 = document.getElementById('s_main');

//鼠标移入动作
card_0.onmouseenter=function(event){
fadeIn("s_main",speed,opa);
}

//鼠标移出动作
card_0.onmouseleave=function(event){
fadeOut("s_main",speed,opa);
}

})();

//渐变函数
function fadeIn(nam,speed,opa)
{
speed/=10;
var element=document.getElementById(nam);
if(element.style.opacity !==1)
{
var num = opa;
var st = setInterval(function()
{
num++;
element.style.opacity = num/10;
if(num>=10){clearInterval(st);}
},speed);
}
}

function fadeOut(nam,speed,opa){
speed/=10;
var element=document.getElementById(nam);
if(element.style.opacity !==opa/10){
var num = 10;
var st = setInterval(function(){
num--;
element.style.opacity = num / 10 ;
if(num<=opa){clearInterval(st);}
},speed);
}
}

jyl12369Author
§
Posted: 22.09.2020

感谢支持感谢支持,不过最近有考试力不从心了,等明年系统研究一下更新脚本~

Post reply

Sign in to post a reply.