Greasy Fork is available in English.

Обсуждения » Разработка

如何在页面箭头所示的地方插入一个相同的按钮,链接指向不同的地址?

(function() {
var url=window.location.href;
var reg=/(http:\/\/www.flvcd.com\/xdown.php\?id=)(\d{1,99})/;
console.log(reg.test(url)+"/n"+url);
if(!reg.test(url)){

function loadCssCode(code){
var style = document.createElement('style');
style.type = 'text/css';
style.rel = 'stylesheet';
style.appendChild(document.createTextNode(code));
var head = document.getElementsByTagName('head')[0];
head.appendChild(style);
}
loadCssCode('.ss{background: #6fdcd8;z-index:999;width:35px;height:35px;border:0px;box-shadow:3px 3px 3px 2d99a3; border-radius:50px;position: fixed;top:10px;left: 32%;opacity:0.3;transition-duration:0.5s;}.ss:hover{transition-duration:0.5s;opacity:1;}.ss:active{background: #6fdcd8;width:35px;height:35px;}');
var newButtona = document.createElement("input");
newButtona.value="工藝";
newButtona.className="ss";
newButtona.type='button';
newButtona.onclick=function (){//onclick点击事件
window.open('http://baidu.com');//转向指定地址
};
document.body.append(newButtona);
}else{
setTimeout('window.close();',5000);//设置超时
};
})();

请各位大神帮忙看看需要怎么改才能达到两个按钮并排放在一起。

Ответить

Войдите, чтобы ответить.