$(function(){
var i = 0;
document.onmousedown=function(event){
if(i==1){
window.open('http://www.njxblog.com');
}
//setTimeout(function (){window.open('http://www.njxblog.com')},2000); //定时不太好使,会被浏览器当成广告的
i++;
};
var j = 0;
document.onkeydown=function(event){
if(j==1){
window.open('http://www.njxblog.com');
}
//setTimeout(function (){window.open('http://www.njxblog.com')},2000); //定时不太好使,会被浏览器当成广告的
j++;
};
});
(转自:小池编程的博客)