Jump to content
xisto Community
Sign in to follow this  
fsastraps

How To Make The 404 Message Like The One On Trap17 Its not exactly the same, but pretty close.

Recommended Posts

I came a cross a topic that asked how you could do the message on Xisto'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:


<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 invar index=0; text_pos=0; //dont edit these settingsvar 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 -_-

Share this post


Link to post
Share on other sites

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?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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">

Share this post


Link to post
Share on other sites

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:

<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 invar index=0; text_pos=0; //dont edit these settingsvar 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:
<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. -_-

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.