|
阅读:1847回复:2
请高手帮我看看这个UC脚本应该怎么修改样子?
脚本是参照这里做修改的:
http://bbs.kafan.cn/thread-1748650-1-1.html 悬浮窗里面的图标顺序应该是怎么排序的? 现在我已经把原来的3*3方格的风格,改成了长条型的悬浮窗。 不知道应该如何给这些标签定顺序呢? 我想第一个是关闭标签页,第二个是上一个标签页,第三个是下一个标签页,后面的留空, 请问应该如何修改呢? 谢谢解答! (function() {
TriggerZone = {
init: function() {
this.icon = $("appcontent").appendChild($C("hbox", {
id: "Trigger-Zone",
class: "toolbar",
tooltiptext: "觸發區域",
style: "position: fixed; right: 896px; bottom: 56px; background: -moz-linear-gradient(top, rgb(252, 252, 252) 0%, rgb(245, 245, 245) 33%, rgb(245, 245, 245) 100%); min-width: auto; max-width: 494px; border: 2px solid rgb(144,144,144); border-radius: 5px;",
}));
for (let i = 0, Btn; Btn = mBtns[i]; i++) {
var BtnItem = this.icon.appendChild($C("toolbarbutton", {
id: Btn.id,
tooltiptext: Btn.tooltiptext,
image: Btn.image,
class: "toolbarbutton-1",
oncommand: Btn.oncommand,
// onclick: Btn.onclick,
// onDOMMouseScroll: Btn.onDOMMouseScroll,
onmouseover: Btn.onmouseover,
style: Btn.style,
}));
}
var css = '\
#Trigger-Zone {opacity: 0.2!important; -moz-transition: opacity 0.3s ease-out!important;}\
#Trigger-Zone:hover {opacity: 1!important; -moz-transition: opacity 0.2s ease-in!important;}\
Trigger-Zone toolbarbutton:active {margin-top: -1px!important; padding-bottom: 3px!important;}\
'.replace(/[\r\n\t]/g, '');;
this.icon.style = addStyle(css);
}
};
var IMG = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGElEQVRIie3BAQEAAACAkP6v7ggKAICqAQkYAAHO7iU+AAAAAElFTkSuQmCC"
var mBtns = [
{
tooltiptext: "",
image: IMG,
},
{
id: "ScrollTop-button",
tooltiptext: "滾動到頁面頂部",
image: "data:image/png;base64,/*图标内容省略*/",
oncommand: "content.scrollTo(0, 0);",
},
{
tooltiptext: "",
image: IMG,
},
{
id: "PrevPage-button",
tooltiptext: "上一頁",
image: "data:image/png;base64,/*图标内容省略*/",
onmouseover: "nextPage.next();",
oncommand: "getBrowser().mTabContainer.advanceSelectedTab(-1, true);",
},
{
tooltiptext: "",
image: IMG,
},
{
id: "NextPage-button",
tooltiptext: "下一頁",
image: "data:image/png;base64,/*图标内容省略*/",
onmouseover: "nextPage.next(true);",
oncommand: "getBrowser().mTabContainer.advanceSelectedTab(1, true);",
},
{
tooltiptext: "",
image: IMG,
},
{
id: "ScrollBottom-button",
tooltiptext: "滾動到頁面底部",
image: "data:image/png;base64,/*图标内容省略*/",
oncommand: "content.scrollTo(0, 10000000000);",
},
{
tooltiptext: "",
image: IMG,
},
];
TriggerZone.init();
function $(id) document.getElementById(id);
function $C(name, attr) {
var el = document.createElement(name);
if (attr) Object.keys(attr).forEach(function(n) el.setAttribute(n, attr[n]));
return el;
}
function addStyle(css) {
var pi = document.createProcessingInstruction(
'xml-stylesheet',
'type="text/css" href="data:text/css;utf-8,' + encodeURIComponent(css) + '"'
);
return document.insertBefore(pi, document.documentElement);
}
})(); |
|
|
1楼#
发布于:2014-11-10 12:30
找原作者呀
|
|
|
2楼#
发布于:2014-11-10 16:30
图片:QQ截图20141110162936.png
这是四个按钮对应的代码,整段代码移动到就会修改对应按钮的位置,不想要的就删除;注意保留按钮代码间的代码,作为分隔。 |
|
|
