Free Games Forum
Free Games Games Forums Music Forums TV Forums

  Free Games Forum Home FORUM
HOME
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN
Rules & FAQ RULES / FAQ
REPORT SPAM

Free Games Forum: Game Technology: Javascript Coding:
javascript help

 

 


Raziel The Soul Reaver
Senior Member


Mar 7, 2005, 12:55 PM

Post #1 of 7 (696 views)
Shortcut
javascript help Can't Post

the words to follow the mosue dotn show up heres the programmign of site:

<html>
<head>
<title>Ryan's Profile</title>
<body>
<SCRIPT LANGUAGE="JavaScript">
message = 'Welcome To Ryan's Profile!';
FonT = 'Verdana';
ColoR = '000080';
SizE = 3; //1 to 7 only!

var amount = 5, ypos =- 50, xpos = 0, Ay = 0, Ax = 0, By = 0, Bx = 0, Cy = 0, Cx = 0, Dy = 0, Dx = 0, Ey = 0, Ex = 0;
if (document.layers) {
for (i = 0; i < amount; i++) {
document.write('<layer name=nsl'+i+' top=0 left=0><font face='+FonT+' size='+SizE+' color='+ColoR+'>'+message+'</font></layer>');
}
window.captureEvents(Event.MOUSEMOVE);
function nsmouse(evnt) {
xpos = evnt.pageX + 20;
ypos = evnt.pageY + 20;
}
window.onMouseMove = nsmouse;
}
else if (document.all) {
document.write("<div id='outer' style='position:absolute;top:0px;left:0px'>");
document.write("<div style='position:relative'>");
for (i = 0; i < amount; i++) {
document.write('<div id="text"'+i+' style="position:absolute;top:0px;left:0px;width:400px;height:20px"><font face='+FonT+' size='+SizE+' color='+ColoR+'>'+message+'</font></div>')
}
document.write("</div>");
document.write("</div>");
function iemouse() {
ypos = event.y + 20;
xpos = event.x + 20;
}
window.document.onmousemove = iemouse;
}
function makefollow() {
if (document.layers) {
document.layers['nsl'+0].top = ay;
document.layers['nsl'+0].left = ax;
document.layers['nsl'+1].top = by;
document.layers['nsl'+1].left = bx;
document.layers['nsl'+2].top = cy;
document.layers['nsl'+2].left = cx;
document.layers['nsl'+3].top = Dy;
document.layers['nsl'+3].left = Dx;
document.layers['nsl'+4].top = Ey;
document.layers['nsl'+4].left = Ex;
}
else if (document.all) {
outer.style.pixelTop = document.body.scrollTop;
text[0].style.pixelTop = ay;
text[0].style.pixelLeft = ax;
text[1].style.pixelTop = by;
text[1].style.pixelLeft = bx;
text[2].style.pixelTop = cy;
text[2].style.pixelLeft = cx;
text[3].style.pixelTop = Dy;
text[3].style.pixelLeft = Dx;
text[4].style.pixelTop = Ey;
text[4].style.pixelLeft = Ex;
}
}
function move() {
ey = Ey += (ypos - Ey) * 0.2;
ex = Ex += (xpos - Ex) * 0.2;
dy = Dy += (ey - Dy) * 0.3;
dx = Dx += (ex - Dx) * 0.3;
cy = Cy += (dy - Cy) * 0.4;
cx = Cx += (dx - Cx) * 0.4;
by = By += (cy - By) * 0.5;
bx = Bx += (cx - Bx) * 0.5;
ay = Ay += (by - Ay) * 0.6;
ax = Ax += (bx - Ax) * 0.6;
makefollow();
setTimeout('move()', 10);
}
window.onload=move;
</script>
</body>

</head>

<body>


<BODY BACKGROUND="http://www.grsites.com/textures/multi/multi273.jpg"><h1><b><center><img src=profilepic.jpg></b></center>
<embed src="profilesong.mid" width="1"
height="1" autostart="true" hidden="true
loop="true">

<font color=#FF0000>
<align=center><i>Well this area of my site is my profile for myspace.com cuz it doesnt allow you to use javascript, this wotn hold much about me for a while because of all the html editing i have to do, so check back every once in awhile.</i></text></align>
</font color=#FF0000>

<br>
<br>
<align=left>
<a href="index.html"><img src=Home.gif></a>
<br>
</align>
<br>
<br>
<IMG SRC=http://visit.webhosting.yahoo.com/counter.gif ALT="Counter">
<br>


</body>
</html>


any ideas of wuts worng?



"For every animal you don't eat, i'm going to eat three"
Quote: Maddox



Cruel__Machine
Senior Member


Mar 7, 2005, 1:50 PM

Post #2 of 7 (690 views)
Shortcut
Re: [Raziel The Soul Reaver] javascript help [In reply to] Can't Post

The apostrophe in this line is the prob:

message = 'Welcome To Ryan's Profile!';


change it to this:
message = "Welcome To Ryan's Profile!";


also, the tags are kind of sloppy. It's not causing problems, but it's good practice to fix them. There are like three body tags. One doesn't have a closing body tag and one of them in in the head tag. I'll post the code of the fixed page in a different post.


EOP
___________________________
"If evolution were true, I'd have a self-lubricating hand."

Programmers: http://Cruels.net


Cruel__Machine
Senior Member


Mar 7, 2005, 1:51 PM

Post #3 of 7 (689 views)
Shortcut
Re: [Cruel__Machine] javascript help [In reply to] Can't Post

<html>
<head>
<title>Ryan's Profile</title>
<SCRIPT LANGUAGE="JavaScript">
message = "Welcome To Ryan's Profile!";
FonT = 'Verdana';
ColoR = '000080';
SizE = 3; //1 to 7 only!

var amount = 5, ypos =- 50, xpos = 0, Ay = 0, Ax = 0, By = 0, Bx = 0, Cy = 0, Cx = 0, Dy = 0, Dx = 0,

Ey = 0, Ex = 0;
if (document.layers) {
for (i = 0; i < amount; i++) {
document.write('<layer name=nsl'+i+' top=0 left=0><font face='+FonT+' size='+SizE+'

color='+ColoR+'>'+message+'</font></layer>');
}
window.captureEvents(Event.MOUSEMOVE);
function nsmouse(evnt) {
xpos = evnt.pageX + 20;
ypos = evnt.pageY + 20;
}
window.onMouseMove = nsmouse;
}
else if (document.all) {
document.write("<div id='outer' style='position:absolute;top:0px;left:0px'>");
document.write("<div style='position:relative'>");
for (i = 0; i < amount; i++) {
document.write('<div id="text"'+i+'

style="position:absolute;top:0px;left:0px;width:400px;height:20px"><font face='+FonT+' size='+SizE+'

color='+ColoR+'>'+message+'</font></div>')
}
document.write("</div>");
document.write("</div>");
function iemouse() {
ypos = event.y + 20;
xpos = event.x + 20;
}
window.document.onmousemove = iemouse;
}
function makefollow() {
if (document.layers) {
document.layers['nsl'+0].top = ay;
document.layers['nsl'+0].left = ax;
document.layers['nsl'+1].top = by;
document.layers['nsl'+1].left = bx;
document.layers['nsl'+2].top = cy;
document.layers['nsl'+2].left = cx;
document.layers['nsl'+3].top = Dy;
document.layers['nsl'+3].left = Dx;
document.layers['nsl'+4].top = Ey;
document.layers['nsl'+4].left = Ex;
}
else if (document.all) {
outer.style.pixelTop = document.body.scrollTop;
text[0].style.pixelTop = ay;
text[0].style.pixelLeft = ax;
text[1].style.pixelTop = by;
text[1].style.pixelLeft = bx;
text[2].style.pixelTop = cy;
text[2].style.pixelLeft = cx;
text[3].style.pixelTop = Dy;
text[3].style.pixelLeft = Dx;
text[4].style.pixelTop = Ey;
text[4].style.pixelLeft = Ex;
}
}
function move() {
ey = Ey += (ypos - Ey) * 0.2;
ex = Ex += (xpos - Ex) * 0.2;
dy = Dy += (ey - Dy) * 0.3;
dx = Dx += (ex - Dx) * 0.3;
cy = Cy += (dy - Cy) * 0.4;
cx = Cx += (dx - Cx) * 0.4;
by = By += (cy - By) * 0.5;
bx = Bx += (cx - Bx) * 0.5;
ay = Ay += (by - Ay) * 0.6;
ax = Ax += (bx - Ax) * 0.6;
makefollow();
setTimeout('move()', 10);
}
window.onload=move;
</script>
</head>


<BODY BACKGROUND="http://www.grsites.com/textures/multi/multi273.jpg"><h1><b><center><img

src=profilepic.jpg></b></center>
<embed src="profilesong.mid" width="1"
height="1" autostart="true" hidden="true
loop="true">

<font color=#FF0000>
<align=center><i>Well this area of my site is my profile for myspace.com cuz it doesnt allow you to use

javascript, this wotn hold much about me for a while because of all the html editing i have to do, so

check back every once in awhile.</i></text></align>
</font color=#FF0000>

<br>
<br>
<align=left>
<a href="index.html"><img src=Home.gif></a>
<br>
</align>
<br>
<br>
<IMG SRC=http://visit.webhosting.yahoo.com/counter.gif ALT="Counter">
<br>


</body>
</html>


EOP
___________________________
"If evolution were true, I'd have a self-lubricating hand."

Programmers: http://Cruels.net


Raziel The Soul Reaver
Senior Member


Mar 8, 2005, 7:05 AM

Post #4 of 7 (685 views)
Shortcut
Re: [Cruel__Machine] javascript help [In reply to] Can't Post

thnx



"For every animal you don't eat, i'm going to eat three"
Quote: Maddox


Raziel The Soul Reaver
Senior Member


Mar 8, 2005, 7:20 AM

Post #5 of 7 (680 views)
Shortcut
Re: [Raziel The Soul Reaver] javascript help [In reply to] Can't Post

hey, do u think you could try to teach me on what some of that stuff means? cuz i wanna know how to position the words and such



"For every animal you don't eat, i'm going to eat three"
Quote: Maddox


Cruel__Machine
Senior Member


Mar 8, 2005, 10:39 AM

Post #6 of 7 (677 views)
Shortcut
Re: [Raziel The Soul Reaver] javascript help [In reply to] Can't Post

Well position is set to two var:

xpos = evnt.pageX + 20;
ypos = evnt.pageY + 20;


just change it so it adds a different number than 20. Or even make it subtract.

Also be sure to mess around with the other vars at the top:

message = "Welcome To Ryan's Profile!";
FonT = 'Verdana';
ColoR = '000080';
SizE = 3; //1 to 7 only!


those are self-explanitory.

But as for other stuff, you're better off reading javascript tutorials and such because I'm not that good at it. I know how to read code, but not write it. Mostly because computer languages are so similar.


EOP
___________________________
"If evolution were true, I'd have a self-lubricating hand."

Programmers: http://Cruels.net

(This post was edited by Cruel__Machine on Mar 8, 2005, 10:40 AM)


Raziel The Soul Reaver
Senior Member


Mar 9, 2005, 10:20 AM

Post #7 of 7 (671 views)
Shortcut
Re: [Cruel__Machine] javascript help [In reply to] Can't Post

k, thnx



"For every animal you don't eat, i'm going to eat three"
Quote: Maddox

 
 
 


Search for (options) Web Design by Web Ideas - Page loaded in: 0.14 s on (CGI/1.1)