Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 09-14-2003, 04:45 AM   #1
Baseband Member
 
OFAH FAN's Avatar
 
Join Date: Sep 2003
Posts: 87
Default Java Script...

Can any1 do this for me please?

Each 30 secs or so i want the quote to change to another one, then another one and so on till it gets to the end then it starts again, i have been told by a freind that u need to know Java to do this..

Here are the Quotes i wish to use

Iíve heard your line of patter my son. If they donít know Adam Antís birthday or the Chelsea result itís goodnight Vienna, innit?
______________________-
Tough? Tough? It's the toughest chicken I've ever known. It's asked me for a fight in the car park twice!
_______________________
There's got to be a way! He who dares wins! There's a million quid worth of gold out there - our gold. We can't just say 'bonjour' to it.
_____________________
Yeah, but I'd like to meet the git who told him he could sing!
_______________________
Yeah, that'll do fine if you're out of Brandy.
______________________
Del knows what he's talking about. And I don't see what the Beatle's manager has got to do with it anyway.
_________________________
How the hell can it be the same bloody broom then?
__________________________
And then they turn up! And within fifteen seconds some sod's shooting' at us!
_____________________
I don't know about St. Claire a la Chappell, they should rename this place Trottersville!
______________________________
Chuck him on the back seat? He's the driver!

If any1 can give me the RIGHT Code for this, i will give tem full credit on my site.
__________________

OFAH FAN is offline   Reply With Quote
Old 09-14-2003, 04:50 AM   #2
Site Team
 
David Lindon's Avatar
 
Join Date: Dec 2002
Posts: 15,233
Default

<script language="JavaScript1.2" type="text/javascript">
<!--
var delay = 1000
var bcolor = "#F8F8F8"
var tcolor = "#D4AD00"
var fcontent = new Array()
begintag = '<font size="2"><B>'
fcontent[0] = "Iíve heard your line of patter my son. If they donít know Adam Antís birthday or the Chelsea result itís goodnight Vienna, innit?"
fcontent[1] = "Tough? Tough? It's the toughest chicken I've ever known. It's asked me for a fight in the car park twice!"
fcontent[2] = "There's got to be a way! He who dares wins! There's a million quid worth of gold out there - our gold. We can't just say 'bonjour' to it."
fcontent[3] = "Yeah, but I'd like to meet the git who told him he could sing"
fcontent[4] = "Yeah, that'll do fine if you're out of Brandy. "
fcontent[5] = "Del knows what he's talking about. And I don't see what the Beatle's manager has got to do with it anyway. "
fcontent[6] = "How the hell can it be the same bloody broom then?"
fcontent[7] = "And then they turn up! And within fifteen seconds some sod's shooting' at us!"
fcontent[8] = "I don't know about St. Claire a la Chappell, they should rename this place Trottersville!"
fcontent[9] = "Chuck him on the back seat? He's the driver! "
closetag = '</b></font>'
// -->
</script>
<script language="javascript">
/************************************************** ******************
allbrowsers_fader.mod
v2.02 01/12/2002
YaBB integration & modification: NRg (yabb_fader@gmx.de)
Latest version: http://www.talknet.de/~norbru/

based upon:
Fading Scroller by DynamicDrive.com http://www.dynamicdrive.com
************************************************** *******************/

// You can changes these three values to modify the output:
var frame = 50; // frame-range. standard = 50
var st = 30; // milliseconds between frames. standard = 30
var wait = 50; // value to display the full text without fade
// 1 = approx. 60 milliseconds. standard = 50

ie4 = document.all&&!document.getElementById;
ns4 = document.layers;
DOM2 = document.getElementById;

bR = HexToR(bcolor);
bG = HexToG(bcolor);
bB = HexToB(bcolor);
tR = HexToR(tcolor);
tG = HexToG(tcolor);
tB = HexToB(tcolor);
bR_m = bR;
bG_m = bG;
bB_m = bB;
tR_m = tR;
tG_m = tG;
tB_m = tB;

function HexToR(h) { return parseInt((cutHex(h)).substring(0,2),16) }
function HexToG(h) { return parseInt((cutHex(h)).substring(2,4),16) }
function HexToB(h) { return parseInt((cutHex(h)).substring(4,6),16) }
function cutHex(h) { return (h.charAt(0)=="#") ? h.substring(1,7) : h}

dir = ((tR+tG+tB) > (bR+bG+bB)) ? "up" : "down";
dirback = ((tR+tG+tB) < (bR+bG+bB)) ? "up" : "down";
dir_m = dir;
index = 0;
frame_m = frame;
framehalf = frame / 2;
wait_m = wait;
stepR = Math.abs(tR - bR) / framehalf;
stepG = Math.abs(tG - bG) / framehalf;
stepB = Math.abs(tB - bB) / framehalf;
step = Math.min(Math.round(Math.max(stepR,Math.max(stepG, stepB))),(240/framehalf));

function fade() {
if (index>=fcontent.length)
index = 0;
if (DOM2) {
document.getElementById("fscroller").innerHTML=beg intag+fcontent[index]+closetag;
index++;
colorfade();
}
else if (ie4) {
document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
index++;
setTimeout("fade()",Math.max(delay,2500));
}
else if (ns4) {
document.fscrollerns.document.fscrollerns_sub.docu ment.write(begintag+fcontent[index]+closetag);
document.fscrollerns.document.fscrollerns_sub.docu ment.close();
index++;
setTimeout("fade()",Math.max(delay,2500));
}
}

function colorfade() {
if (frame>0) {
if (frame==framehalf && wait>0) {
document.getElementById("fscroller").style.color=" rgb("+wR+","+wG+","+wB+")";
wait--;
setTimeout("colorfade()",50);
}
else {
if (dir=="down") {
if (bR>tR) bR-=step;
if (bG>tG) bG-=step;
if (bB>tB) bB-=step;
bR = Math.max(bR,1);
bG = Math.max(bG,1);
bB = Math.max(bB,1);
}
else {
if (bR<tR) bR+=step;
if (bG<tG) bG+=step;
if (bB<tB) bB+=step;
bR = Math.min(bR,255);
bG = Math.min(bG,255);
bB = Math.min(bB,255);
}
document.getElementById("fscroller").style.color=" rgb("+bR+","+bG+","+bB+")";
if (frame==framehalf+1) {
document.getElementById("fscroller").style.color=" rgb("+tR+","+tG+","+tB+")";
dir = dirback;
wR = tR;
wG = tG;
wB = tB;
tR = bR_m;
tG = bG_m;
tB = bB_m;
}
frame--;
setTimeout("colorfade()",st);
}
}
else {
document.getElementById("fscroller").innerHTML=" ";
dir = dir_m;
frame = frame_m;
wait = wait_m;
tR = tR_m;
tG = tG_m;
tB = tB_m;
bR = bR_m;
bG = bG_m;
bB = bB_m;
setTimeout("fade()",delay);
}
}
</script>
<script language="JavaScript1.2" type="text/javascript">
<!--
if (navigator.appVersion.substring(0,1) < 5 && navigator.appName == "Netscape") {
var fwidth = screen.availWidth / 2;
var bwidth = screen.availWidth / 4;
document.write('<ilayer id="fscrollerns" width='+fwidth+' height=35 left='+bwidth+' top=0><layer id="fscrollerns_sub" width='+fwidth+' height=35 left=0 top=0></layer></ilayer>');
window.onload = fade;
}
else if (navigator.userAgent.search(/Opera/) != -1 || (navigator.platform != "Win32" && navigator.userAgent.indexOf('Gecko') == -1)) {
document.open();
document.write('<div id="fscroller" style="width:90%; height:15px; padding:2px">');
for(i=0; i < fcontent.length; ++i) {
document.write(begintag+fcontent[i]+closetag+'<br>');
}
document.write('</div>');
document.close();
window.onload = fade;
}
else {
document.write('<div id="fscroller" style="width:90% height:15px; padding:2px"></div>');
window.onload = fade;
}
// -->
</script>
__________________

__________________
[url=http://www.LNXPS.NET]LNXPS.NET - The XPS Library]
David Lindon is offline   Reply With Quote
Old 09-14-2003, 04:54 AM   #3
Site Team
 
David Lindon's Avatar
 
Join Date: Dec 2002
Posts: 15,233
Default Re: Java Script...

You can change the colors and so on. Can you put a link to www.Matrix28.com as the credit, thanks, Dave.
__________________
[url=http://www.LNXPS.NET]LNXPS.NET - The XPS Library]
David Lindon is offline   Reply With Quote
Old 09-14-2003, 04:58 AM   #4
Baseband Member
 
OFAH FAN's Avatar
 
Join Date: Sep 2003
Posts: 87
Default Re: Java Script...

Yea sure i will, so all i have to do is copy and paste now?
OFAH FAN is offline   Reply With Quote
Old 09-14-2003, 04:59 AM   #5
Site Team
 
David Lindon's Avatar
 
Join Date: Dec 2002
Posts: 15,233
Default Re: Java Script...

Yep.
__________________
[url=http://www.LNXPS.NET]LNXPS.NET - The XPS Library]
David Lindon is offline   Reply With Quote
Old 09-14-2003, 05:09 AM   #6
Baseband Member
 
OFAH FAN's Avatar
 
Join Date: Sep 2003
Posts: 87
Default Re: Java Script...

It Works!!! Thanks man, U Rule, Thanks Again
OFAH FAN is offline   Reply With Quote
Old 09-14-2003, 05:13 AM   #7
Site Team
 
David Lindon's Avatar
 
Join Date: Dec 2002
Posts: 15,233
Default Re: Java Script...

Thanks!
__________________
[url=http://www.LNXPS.NET]LNXPS.NET - The XPS Library]
David Lindon is offline   Reply With Quote
Old 09-14-2003, 05:16 AM   #8
Baseband Member
 
OFAH FAN's Avatar
 
Join Date: Sep 2003
Posts: 87
Default Re: Java Script...

Is there anyway you could slaw it down just a tad?
OFAH FAN is offline   Reply With Quote
Old 09-14-2003, 05:23 AM   #9
Baseband Member
 
OFAH FAN's Avatar
 
Join Date: Sep 2003
Posts: 87
Default Re: Java Script...

No nEED i have figured out, thanks
OFAH FAN is offline   Reply With Quote
Old 09-14-2003, 05:25 AM   #10
Site Team
 
David Lindon's Avatar
 
Join Date: Dec 2002
Posts: 15,233
Default

Give this a try:

<script language="JavaScript1.2" type="text/javascript">
<!--
var delay = 1500
var bcolor = "#F8F8F8"
var tcolor = "#D4AD00"
var fcontent = new Array()
begintag = '<font size="2"><B>'
fcontent[0] = "Iíve heard your line of patter my son. If they donít know Adam Antís birthday or the Chelsea result itís goodnight Vienna, innit?"
fcontent[1] = "Tough? Tough? It's the toughest chicken I've ever known. It's asked me for a fight in the car park twice!"
fcontent[2] = "There's got to be a way! He who dares wins! There's a million quid worth of gold out there - our gold. We can't just say 'bonjour' to it."
fcontent[3] = "Yeah, but I'd like to meet the git who told him he could sing"
fcontent[4] = "Yeah, that'll do fine if you're out of Brandy. "
fcontent[5] = "Del knows what he's talking about. And I don't see what the Beatle's manager has got to do with it anyway. "
fcontent[6] = "How the hell can it be the same bloody broom then?"
fcontent[7] = "And then they turn up! And within fifteen seconds some sod's shooting' at us!"
fcontent[8] = "I don't know about St. Claire a la Chappell, they should rename this place Trottersville!"
fcontent[9] = "Chuck him on the back seat? He's the driver! "
closetag = '</b></font>'
// -->
</script>
<script language="javascript">
/************************************************** ******************
allbrowsers_fader.mod
v2.02 01/12/2002
YaBB integration & modification: NRg (yabb_fader@gmx.de)
Latest version: http://www.talknet.de/~norbru/

based upon:
Fading Scroller by DynamicDrive.com http://www.dynamicdrive.com
************************************************** *******************/

// You can changes these three values to modify the output:
var frame = 70; // frame-range. standard = 50
var st = 50; // milliseconds between frames. standard = 30
var wait = 60; // value to display the full text without fade
// 1 = approx. 60 milliseconds. standard = 50

ie4 = document.all&&!document.getElementById;
ns4 = document.layers;
DOM2 = document.getElementById;

bR = HexToR(bcolor);
bG = HexToG(bcolor);
bB = HexToB(bcolor);
tR = HexToR(tcolor);
tG = HexToG(tcolor);
tB = HexToB(tcolor);
bR_m = bR;
bG_m = bG;
bB_m = bB;
tR_m = tR;
tG_m = tG;
tB_m = tB;

function HexToR(h) { return parseInt((cutHex(h)).substring(0,2),16) }
function HexToG(h) { return parseInt((cutHex(h)).substring(2,4),16) }
function HexToB(h) { return parseInt((cutHex(h)).substring(4,6),16) }
function cutHex(h) { return (h.charAt(0)=="#") ? h.substring(1,7) : h}

dir = ((tR+tG+tB) > (bR+bG+bB)) ? "up" : "down";
dirback = ((tR+tG+tB) < (bR+bG+bB)) ? "up" : "down";
dir_m = dir;
index = 0;
frame_m = frame;
framehalf = frame / 2;
wait_m = wait;
stepR = Math.abs(tR - bR) / framehalf;
stepG = Math.abs(tG - bG) / framehalf;
stepB = Math.abs(tB - bB) / framehalf;
step = Math.min(Math.round(Math.max(stepR,Math.max(stepG, stepB))),(240/framehalf));

function fade() {
if (index>=fcontent.length)
index = 0;
if (DOM2) {
document.getElementById("fscroller").innerHTML=beg intag+fcontent[index]+closetag;
index++;
colorfade();
}
else if (ie4) {
document.all.fscroller.innerHTML=begintag+fcontent[index]+closetag;
index++;
setTimeout("fade()",Math.max(delay,2500));
}
else if (ns4) {
document.fscrollerns.document.fscrollerns_sub.docu ment.write(begintag+fcontent[index]+closetag);
document.fscrollerns.document.fscrollerns_sub.docu ment.close();
index++;
setTimeout("fade()",Math.max(delay,2500));
}
}

function colorfade() {
if (frame>0) {
if (frame==framehalf && wait>0) {
document.getElementById("fscroller").style.color=" rgb("+wR+","+wG+","+wB+")";
wait--;
setTimeout("colorfade()",50);
}
else {
if (dir=="down") {
if (bR>tR) bR-=step;
if (bG>tG) bG-=step;
if (bB>tB) bB-=step;
bR = Math.max(bR,1);
bG = Math.max(bG,1);
bB = Math.max(bB,1);
}
else {
if (bR<tR) bR+=step;
if (bG<tG) bG+=step;
if (bB<tB) bB+=step;
bR = Math.min(bR,255);
bG = Math.min(bG,255);
bB = Math.min(bB,255);
}
document.getElementById("fscroller").style.color=" rgb("+bR+","+bG+","+bB+")";
if (frame==framehalf+1) {
document.getElementById("fscroller").style.color=" rgb("+tR+","+tG+","+tB+")";
dir = dirback;
wR = tR;
wG = tG;
wB = tB;
tR = bR_m;
tG = bG_m;
tB = bB_m;
}
frame--;
setTimeout("colorfade()",st);
}
}
else {
document.getElementById("fscroller").innerHTML=" ";
dir = dir_m;
frame = frame_m;
wait = wait_m;
tR = tR_m;
tG = tG_m;
tB = tB_m;
bR = bR_m;
bG = bG_m;
bB = bB_m;
setTimeout("fade()",delay);
}
}
</script>
<script language="JavaScript1.2" type="text/javascript">
<!--
if (navigator.appVersion.substring(0,1) < 5 && navigator.appName == "Netscape") {
var fwidth = screen.availWidth / 2;
var bwidth = screen.availWidth / 4;
document.write('<ilayer id="fscrollerns" width='+fwidth+' height=35 left='+bwidth+' top=0><layer id="fscrollerns_sub" width='+fwidth+' height=35 left=0 top=0></layer></ilayer>');
window.onload = fade;
}
else if (navigator.userAgent.search(/Opera/) != -1 || (navigator.platform != "Win32" && navigator.userAgent.indexOf('Gecko') == -1)) {
document.open();
document.write('<div id="fscroller" style="width:90%; height:15px; padding:2px">');
for(i=0; i < fcontent.length; ++i) {
document.write(begintag+fcontent[i]+closetag+'<br>');
}
document.write('</div>');
document.close();
window.onload = fade;
}
else {
document.write('<div id="fscroller" style="width:90% height:15px; padding:2px"></div>');
window.onload = fade;
}
// -->
</script>
__________________

__________________
[url=http://www.LNXPS.NET]LNXPS.NET - The XPS Library]
David Lindon is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 09:54 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0