Tabfun

From XPUB & Lens-Based wiki
Revision as of 19:24, 6 October 2014 by Lbattich (talk | contribs)

link

<!DOCTYPE html>
<html>
<head>

<title>HELP</title>
<style>
span {
	background: blue;
	color: purple;
	}
div{
	display: inline-block;
	}	
body{background: #CCCCFF;
transition: background 0.5s linear;}



</style>
</head>
<body>

<script>
		
window.addEventListener("beforeunload", function( event ) {
	
	for (i = 0; i < 2; i++) {
		var ntab=window.open("HELP.html");


//ntab.document.write("more fun");
}
 
});



</script>
</body>
</html>

another version (with lucas' help) (you are welcome)

<!DOCTYPE html>
<html>
<head>
 
<title>HELP</title>
<style>
span {
	background: blue;
	color: purple;
	}
div{
	display: inline-block;
	}	
body{background: #CCCCFF;
transition: background 0.5s linear;}
 
 button {
	color: red;
	}
 
</style>
</head>
<body>
<button id="but" onclick="tabs()" type="button" style="position:absolute;">more fun</button>
 
<script>
var x = document.getElementById("but");
setInterval(function(){timer()},2000);
//window.addEventListener("beforeunload", tabs(event));

function timer()
{
x.style.top=Math.floor(Math.random()*101)+"%";
x.style.left=Math.floor(Math.random()*101)+"%";
x.style.top=Math.floor(Math.random()*101)+"%";
x.style.left=Math.floor(Math.random()*101)+"%";
x.innerHTML="even more fun";
}

function tabs(event) {
  timer();
 
	for (i = 0; i < 1; i++) {
		var ntab=window.open("HELP.html");
 
//ntab.document.write("more fun");
}

}
 
 
 
</script>
</body>
</html>