-
Oct 23rd, 2012, 10:55 AM
#1
Thread Starter
Addicted Member
Writing text on whole page
I had an idea to repeat same code as I saw on the internet few days ago. It looked like this: On whole screen there were numbers like 0 and 1 (binary system) and those numbers constantly changed value from 0 to 1 and reverse. It was fast but not lighting speed, the speed normal to enjoy the change. I'd like to do that also but when I try to type whole bunch of numbers on the webpage using javascript I just can't find the way. Can anyone help me with that?
-
Oct 24th, 2012, 01:52 AM
#2
Re: Writing text on whole page
Use loops to repeat printing it. Inside it, you could add conditions to swap printing of the 0's or 1's on each iteration. Or you could use the Math.random() function which generates a random number.
You could use it like this on each iteration:
Code:
num = Math.round(Math.random());
Or are you talking about the numbers in the screen fading to another one and viceversa or something like that ? Can you post the link to that page ?
If my post was helpful to you, then express your gratitude using Rate this Post.
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Oct 24th, 2012, 03:51 AM
#3
Thread Starter
Addicted Member
Re: Writing text on whole page
It was hacked website of some gouvernment, but now there us nothing. I am not interested in hacking for sure, just wanted to see how to make that effect with javascript. It looked like this:
-Whole page with numbers 0 and 1 .
-Small font-size of those numbers.
-Low opacity of font.
-When website load the numbers start changeing from 0 to 1 and reverse.
I tried random number but all numbers go in same row and keep going forever.
-
Oct 24th, 2012, 04:56 AM
#4
Re: Writing text on whole page
Last edited by akhileshbc; Oct 24th, 2012 at 05:02 AM.
If my post was helpful to you, then express your gratitude using Rate this Post.
And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet
Social Group: VBForums - Developers from India
Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...
-
Oct 24th, 2012, 10:27 AM
#5
Thread Starter
Addicted Member
Re: Writing text on whole page
Oh ok. But the question I asked here was because I wanted to learn this part with javascript. I know also to do that with Photoshop but thanks again for giving me that idea. Just wanted to see how that work with js.
-
Oct 24th, 2012, 11:50 AM
#6
Re: Writing text on whole page
Hi there Mr.Joker
Here is an example for you to play with....
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title>binary page</title>
<style type="text/css">
html,body {
height:100%;
margin:0;
overflow:hidden;
background-color:#111;
}
#newtable td {
padding:4px;
font-family:'courier new',monospace;
font-size:32px;
color:#eee;
}
</style>
<script type="text/javascript">
function init(){
speed=1500; /* this value is editable */
row=[];
cell=[];
rowNum=40;
cellNum=80;
tab=document.createElement('table');
tab.setAttribute('id','newtable');
tbo=document.createElement('tbody');
for(c=0;c<rowNum;c++){
row[c]=document.createElement('tr');
for(k=0;k<cellNum;k++) {
cell[k]=document.createElement('td');
cont=document.createTextNode(Math.floor(Math.random()*2))
cell[k].appendChild(cont);
row[c].appendChild(cell[k]);
}
tbo.appendChild(row[c]);
}
tab.appendChild(tbo);
document.body.appendChild(tab);
swapnumbers()
}
function swapnumbers() {
cells=document.getElementById('newtable').getElementsByTagName('td');
numbers=cells.length;
for(c=0;c<numbers;c++) {
cells[c].firstChild.nodeValue=Math.floor(Math.random()*2);
}
setTimeout(function(){swapnumbers()},speed);
}
window.addEventListener?
window.addEventListener('load',init,false):
window.attachEvent('onload',init);
</script>
</head>
<body>
<div></div>
</body>
</html>
~ the original bald headed old fart ~
-
Oct 24th, 2012, 12:59 PM
#7
Thread Starter
Addicted Member
Re: Writing text on whole page
Thanks man. Wish I can give you both reputation .
-
Oct 24th, 2012, 01:12 PM
#8
Re: Writing text on whole page
No problem, you're very welcome.
~ the original bald headed old fart ~
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|