autclick:マウスがリンク上に2秒留まったら自動的にリンクを開く(uc.jsスクリプト)
4992 ワード
var AutoClick = {
TimeoutID: null,
ClickTarget : null,
mouseover: function(ev) {
try {
var localName = ev.target.localName;
}catch(e) { }
if (localName.toLowerCase()=='a' && ev.target.
href.indexOf('javascript:')==-1) {
this.ClickTarget = ev.target;
this.TimeoutID = window.setTimeout(AutoClick
.autoclick, 2000);
}
},
mouseout: function(ev) {
this.ClickTarget = null;
if (this.TimeoutID) {
window.clearTimeout(this.TimeoutID);
this.TimeoutID = null;
}
},
click: function(ev) {
this.ClickTarget = null;
return ev.target ? true : false;
},
autoclick: function() {
if (!this.ClickTarget) return;
if (this.ClickTarget.target == '_blank')
gBrowser.loadOneTab(this.ClickTarget.href,
null, null, null, false, true);
else
loadURI(this.ClickTarget.href);
this.ClickTarget = null;
},
};
window.addEventListener('mouseover', AutoClick.mouseover, false);
window.addEventListener('mouseout', AutoClick.mouseout, false);
window.addEventListener('click', AutoClick.click, false);
ウェブサイトの滞在時間コードはどれぐらいですか?
<html>
<head>
<title> (www.51zjs.cn)- </title>
<style type="text/css">
<!--
body { font-family: " "; font-size: 9pt; margin-top: 0px; margin-left: 4px; margin-right: 0px}
A { COLOR: black; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: none }
A:hover { COLOR: red; FONT-SIZE: 13px; FONT-WEIGHT: 400; TEXT-DECORATION: underline }
a:active { font: 9pt " "; cursor: hand; color: #FF0033 }
--></style>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<br>
<br>
<center><font color=red face=" " size=6> </font></center>
<br>
<center>
<table border=0 bordercolor=blue borderlight=green style="border-collapse: collapse" cellpadding="0" cellspacing="0">
<tr><td align=center><font size=5 color=red face="Arial, Helvetica, sans-serif"><strong> </strong></font></td></tr>
<tr><td align=center>
<script LANGUAGE="JavaScript">
<!-- Begin
day = new Date();
miVisit = day.getTime();
function clock() {
today = new Date();
hrNow = today.getHours();
mnNow = today.getMinutes();
scNow = today.getSeconds();
miNow = today.getTime();
if (hrNow == 0) {
hour = 12;
ap = "AM";
} else if(hrNow <= 11) {
ap = "AM";
hour = hrNow;
} else if(hrNow == 12) {
ap = "PM";
hour = 12;
} else if (hrNow >= 13) {
hour = (hrNow - 12);
ap = "PM";
}
if (hrNow >= 13) {
hour = hrNow - 12;
}
if (mnNow <= 9) {
min = "0" + mnNow;
}
else (min = mnNow)
if (scNow <= 9) {
secs = "0" + scNow;
} else {
secs = scNow;
}
time = hour + ":" + min + ":" + secs + ap;
document.form.button.value = time;
setTimeout('clock()', 1000);
}
function timeInfo() {
milliSince = miNow;
milliNow = miNow - miVisit;
secsVisit = Math.round(milliNow / 1000);
minsVisit = (milliNow / 1000) / 60;
alert(" : "
+ " " + minsVisit + " "
+ secsVisit + " ");
}
document.write("<left><form name=\"form\">"
+ "<input type=button value=\"Click for info!\""
+ " name=button onClick=\"timeInfo()\"></form></left>");
onError = null;
clock();
// End -->
</script>
</td></tr></table></center>
<br>
<br>
<center>
<SCRIPT LANGUAGE="JavaScript">
<!-- hide
function goHist(a)
{
history.go(a);
}
//-->
</script>
</center>
<br>
<center>
<br>
<br>
</body>
</html>