|
|
|
|
![]() ![]() |
Apr 27 2005, 07:30 PM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 224 Joined: 22-February 05 Member No.: 3,909 |
I came a cross a topic that asked how you could do the message on trap17's 404 page, and i found the code that would do this.
Well it works pretty much the same way, it only looks a little different, you might be able to change the background of the textarea to match the background, and you can possibly take the scrollbar off, and then i think it would look the same. but here it is: CODE <script type="text/javascript" language="Javascript"> var tl=new Array( "Text Here!", "Text for next line HERE!.", "This would be the last line that would be shown, dont put a comma after the quotations, because it will cause an error" ); var speed=80; //You can chage the speed at which the characters are typed in var index=0; text_pos=0; //dont edit these settings var str_length=tl[0].length; var contents, row; function type_text() { contents=''; row=Math.max(0,index-6); while(row<index) contents += tl[row++] + '\r\n'; document.textform.elements[0].value = contents + tl[index].substring(0,text_pos) + "_"; if(text_pos++==str_length) { text_pos=0; index++; if(index!=tl.length) { str_length=tl[index].length; setTimeout("type_text()",1500); //this is how much time will pass till the next line is shown } } else setTimeout("type_text()",speed); } function MM_callJS(jsStr) { //v2.0 return eval(jsStr) } //--> </script> <center> <form name="textform"> <textarea cols="70" rows="8" wrap="soft" readonly> </textarea> </form> Inside the body tag type in onload="type_text();" And thats it! Hope you like it |
|
|
|
Apr 28 2005, 12:45 AM
Post
#2
|
|
|
Advanced Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 143 Joined: 29-March 05 From: Ontario, Canada Member No.: 4,983 |
Hehe I like the Trap17 error page. Check out mine if you want hehe http://zhe.trap17.com/asdasd
|
|
|
|
Apr 28 2005, 01:08 AM
Post
#3
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 372 Joined: 14-October 04 Member No.: 1,736 |
Hmm...thanks for that. Looks interesting! To change the background for the textarea, though, you need to remove the readonly for it. Also, is there any way to remove the small "border" that the textarea makes? I'm sorta wanting to remove it. Or is there at least a way to change it's color?
|
|
|
|
Apr 28 2005, 01:20 AM
Post
#4
|
|
|
Moderator ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 2,325 Joined: 8-March 05 From: Mawson, Antarctica Member No.: 4,254 |
QUOTE(tonic @ Apr 27 2005, 09:45 PM) Your 404 page is very mean. Nice and catchy music, but mean. Why? It took me a good 5 minutes to realized that it repeats itself. |
|
|
|
Apr 28 2005, 01:41 AM
Post
#5
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 224 Joined: 22-February 05 Member No.: 3,909 |
Yeah i was looking at that two until i found it repeated! ahha
Well anyhow, you can change the background color by typing in: <textarea cols="70" rows="8" wrap="soft" readonly style="background:orange"> i think in the style thing you can also take the scrollbar out, but i dont know how to do that. |
|
|
|
Apr 28 2005, 01:59 AM
Post
#6
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 372 Joined: 14-October 04 Member No.: 1,736 |
I'll use your code to explain this:
To remove the scrollbar, you just simply add scrolling="no". So, this is the code: <textarea cols="70" rows="8" wrap="soft" readonly style="background:orange" scrolling="no"> |
|
|
|
Apr 29 2005, 10:58 PM
Post
#7
|
|
|
Moderator ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 2,325 Joined: 8-March 05 From: Mawson, Antarctica Member No.: 4,254 |
I'd like to add to fsastraps' tutorial.
With his code, the message box will be the first thing that appears in your 404 page. This is really bad for you if you have something else that you want to show first on the page. In my "mini-tutorial", I will show you how to position your 404 error anywhere on your page! First, insert the following code between the HEAD tags: CODE <script type="text/javascript" language="Javascript"> var tl=new Array( "Hi,", "This is a 404 error message...", "that you must place between your <head> </head> tags.", "Remember not to put a comma at the end", "or else it will not run :)" ); var speed=80; //You can chage the speed at which the characters are typed in var index=0; text_pos=0; //dont edit these settings var str_length=tl[0].length; var contents, row; function type_text() { contents=''; row=Math.max(0,index-6); while(row<index) contents += tl[row++] + '\r\n'; document.textform.elements[0].value = contents + tl[index].substring(0,text_pos) + "_"; if(text_pos++==str_length) { text_pos=0; index++; if(index!=tl.length) { str_length=tl[index].length; setTimeout("type_text()",1500); //this is how much time will pass till the next line is shown } } else setTimeout("type_text()",speed); } function MM_callJS(jsStr) { //v2.0 return eval(jsStr) } //--> </script> Now, place the follow code ANYWHERE you want your message to appear: CODE <form name="textform"> <textarea cols="70" rows="8" wrap="soft" style="border: 0;" readonly></textarea> </form> Here is my 404 error. Feel free to look at the source code to see what I mean. |
|
|
|
Apr 30 2005, 12:04 AM
Post
#8
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 661 Joined: 18-April 05 Member No.: 5,852 |
Thanks alot for this great tutorial. It should help me out alot. Happy foruming.
|
|
|
|
![]() ![]() |
Similar Topics
| Topics | Topics | |
|---|---|---|
|
|
|