المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : News clicker to your site



bahattab
04-03-2008, 12:11 PM
Add a javascript newsclicker to your site


1) Add this script in between the <head> tags. Follow the instructions within the script below to configure your messages


<script language="javascript">
<!--
var lgth=0;
///////////////////////////////////////////////////////////////////////////////
// Follow these steps to configure this script
// 1) Add your messages below (change a1, a2 etc to whatever text you want)
// 2) Change davesitems to reflect the number of messages you have e.g.
// davesitems=new items(a1,a2,a3,a4,a5); or whatever
// 3) Place this script in between your head tags
// 4) Add the "onload" command to your body tag
// 5) Place the text box <form> ....</form> anywhere within the body tags and that's it.
///////////////////////////////////////////////////////////////////////////////


//list news items here (use as many as you need. Use quotes around each one and end each line with a semicolon)
var a1="Hello how are you?";
var a2="This script is useful for keeping your viewers informed";
var a3="this is the last message";

//Follow the format below, e.g. the next message would be a4, a5 etc.
davesitems=new items(a1,a2,a3);

// **** Do not alter below this line *****************************************
var ini=0; var st=0; var x=davesitems[0].length;
function items() {
lgth=items.arguments.length;
for (i=0; i<lgth; i++)
this[i]=items.arguments[i];}
function newsclicker(){
var temp=davesitems[ini].substring(0,st)+"_";
document.davesnewsform.davestextbox.value=temp;
if(st++==x) {
//Adjust timer for delay between messages
st=0; setTimeout("newsclicker()",1000); ini++;
if(ini==lgth) ini=0; x=davesitems[ini].length;
} else
//adjust timer for "clicking speed" eg letter,letter,letter....
setTimeout("newsclicker()",10);}
//-->
</script>


2) Add this to your <body> tag.

<body onload="newsclicker()">
3) Place this where you want the message to appear


<form name="davesnewsform">
<input type="text" size="52" name="davestextbox" style="color:white; background color:black" >
</form>




full code :



<html dir="rtl">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>New Page 3</title>


<script language="javascript">
<!--
var lgth=0;
///////////////////////////////////////////////////////////////////////////////
// Follow these steps to configure this script
// 1) Add your messages below (change a1, a2 etc to whatever text you want)
// 2) Change davesitems to reflect the number of messages you have e.g.
// davesitems=new items(a1,a2,a3,a4,a5); or whatever
// 3) Place this script in between your head tags
// 4) Add the "onload" command to your body tag
// 5) Place the text box <form> ....</form> anywhere within the body tags and that's it.
///////////////////////////////////////////////////////////////////////////////


//list news items here (use as many as you need. Use quotes around each one and end each line with a semicolon)
var a1="Hello how are you?";
var a2="This script is useful for keeping your viewers informed";
var a3="this is the last message";

//Follow the format below, e.g. the next message would be a4, a5 etc.
davesitems=new items(a1,a2,a3);

// **** Do not alter below this line *****************************************
var ini=0; var st=0; var x=davesitems[0].length;
function items() {
lgth=items.arguments.length;
for (i=0; i<lgth; i++)
this[i]=items.arguments[i];}
function newsclicker(){
var temp=davesitems[ini].substring(0,st)+"_";
document.davesnewsform.davestextbox.value=temp;
if(st++==x) {
//Adjust timer for delay between messages
st=0; setTimeout("newsclicker()",1000); ini++;
if(ini==lgth) ini=0; x=davesitems[ini].length;
} else
//adjust timer for "clicking speed" eg letter,letter,letter....
setTimeout("newsclicker()",10);}
//-->
</script>



</head>

<body onload="newsclicker()">

<form name="davesnewsform">
<p align="center">
<input type="text" size="52" name="davestextbox" style="color:white; background color:black">
</p>
</form>



</body>

</html>




http://www.globalrph.com/davescripts/click.htm