• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

I don't know what to put as a subject ^_^

Christopher

New Member
Ok, you know in javascript you can have those scrollers that look like someone is just typing text to the screen? Is there a way to do that without having a text box etc.? I know you could do it with flash, but I need to test user input and then "type" some data to the screen.
 
Do you mean making a user input box turn into the "marque"?

Although I don't feel like writing it up or even know if I could code it myself.

Basically just create a variable for the marque text like

if button = true then
marquetext = textbox
end if

if you get what I am saying

If you already know jscript then that should help you if you don't then sorry I wasn't of much help I need to freshen up on my programing myself
 
This script types the messages on the screen without any text box .It uses DHTML,you can see a working example at
http://naveed.xug.net/example.html
Code:
<script language="Javascript1.2"> 
<!--
//Please Do not remove.
//Naveed Afzal
//naveed_afzal03@yahoo.com

var tags_before_clock = "<h1>";//Edit it to the size you want
var tags_after_clock  = "</h1>";//Edit it to the size you want
var speed = 100;
//The "speed" variable is the time in milliseconds that each new letter is added in.

var speed2 = 1000;
//The "speed2" variable is the waiting time 'till the next phrase after all the text has been displayed.

function initArray() {

this.length = initArray.arguments.length;
  for (var i = 0; i < this.length; i++) {
  this[i] = initArray.arguments[i];
  }
}

var mymessage = new initArray(
"This is an example of javascript typewriter.",//----Edit these messages----
"It is a scroller without text box.",//----Edit these messages---
"Live,Long,Life.",
"Please Thank to author who created it."
);

var mymessage2 = mymessage;
var x = 0;
var y = 0;

if(navigator.appName == "Netscape") {
document.write('<layer id="ticker"></layer><br>');
}

if (navigator.appVersion.indexOf("MSIE") != -1){
document.write('<span id="ticker"></span><br>');
}

function upticker(){ 

if (y > mymessage2.length - 1) {
  y = 0;
  setTimeout("upticker()",speed);
}

else{

  if (x > mymessage2[y].length) {
    mymessage = mymessage2[y]; 
    x = 0; y++;
    setTimeout("upticker()",speed2);
  }

  else {
    mymessage = mymessage2[y].substring(0,x++);
    setTimeout("upticker()",speed);
  }

  if(navigator.appName == "Netscape") {
    document.ticker.document.write(tags_before_clock+mymessage+tags_after_clock);
    document.ticker.document.close();
  }

  if (navigator.appVersion.indexOf("MSIE") != -1){
    ticker.innerHTML = tags_before_clock+mymessage+tags_after_clock;
  }
}
} 

setTimeout("upticker()",speed);
//-->
</script>
You have to modify it if you need to test user input..:p
 
Back
Top