Tabfun: Difference between revisions
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
Latest revision as of 01:08, 7 May 2016
- first try:
<!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 < 3; 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>
- yet another:
<source lang="html4strict"> <!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;">tabs</button> <button id="but2" onclick="tabs()" type="button" style=" position:absolute;">tabs</button> <button id="but3" onclick="tabs()" type="button" style="position:absolute;">tabs</button> <button id="but4" onclick="tabs()" type="button" style="position:absolute;">tabs</button>
<script> var x = document.getElementById("but"); setInterval(function(){timer()},1200);
var y = document.getElementById("but2"); setInterval(function(){timer2()},1200);
var z = document.getElementById("but3"); setInterval(function(){timer3()},1200);
var w = document.getElementById("but4"); setInterval(function(){timer4()},1200);
//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="more tabs"; }
function timer2() { y.style.bottom=Math.floor(Math.random()*101)+"%"; y.style.right=Math.floor(Math.random()*101)+"%"; y.style.bottom=Math.floor(Math.random()*101)+"%"; y.style.right=Math.floor(Math.random()*101)+"%"; y.innerHTML="even more tabs"; }
function timer3() { z.style.top=Math.floor(Math.random()*104)+"%"; z.style.left=Math.floor(Math.random()*105)+"%"; z.style.top=Math.floor(Math.random()*107)+"%"; z.style.left=Math.floor(Math.random()*109)+"%"; z.innerHTML="?"; }
function timer4() { w.style.bottom=Math.floor(Math.random()*101)+"%"; w.style.right=Math.floor(Math.random()*101)+"%"; w.style.bottom=Math.floor(Math.random()*101)+"%"; w.style.right=Math.floor(Math.random()*101)+"%"; w.innerHTML="!"; }
function tabs(event) {
timer(); timer2(); timer3(); timer4();
for (i = 0; i < 4; i++) { var x=window.open("morehelp.html");
//ntab.document.write("more fun");
}
}
</script> </body> </html> </script>