View Full Version : Mouse animation issue

02-18-2007, 05:48 AM
Well hellow there everyone,

I have this script which is basically supposed to make the cursor (edited) that is supposed to go from event.clientX to event.clientX+10 adding 1 each time can anyone please tell me wht exactly went wrong -

var a = document.getElementById('ctext').style.left=event.clientX
var b = document.getElementById('ctext').style.left=event.clientX+100
function asd() {
if (a<b) {
else {
<body bgcolor="black" onmousemove="asd()">
<div align="center">
<span id="ctext" style="position: absolute;"><img src="1.gif"><font color="yellow">FEAR ME</font><img src="1.gif"></span>

So plz can any1 help me off here :),
Thanks For Your Time :D

02-18-2007, 10:18 AM
Can any one please help me now - i really gotta now !!! :(

02-18-2007, 09:28 PM
C'mon please ???

02-18-2007, 09:37 PM
You can't use document.getElementById outside of the body, which you have done. Also, you cannot define a variable within a variable:

var a = document.getElementById('ctext').style.left=event.clientX
You are trying to assign ctext's style left to event.clientX within a variable which cannot be done. Use:

var a = document.getElementById('ctext').style.left

02-18-2007, 09:43 PM
WOW i did'nt now about the document part but the second part is not completely understood, i mean i have written that it s equal to event.

Anyway seriously thanks for the reply - KNOWLEGDE EQUALS POWER

(actully nooo that's a lie if someone had two bazookas and a turret facing your way knowlegde would not do anything it would probably come out the other side of your head LOL)

But the thing is what about the animation, what's wrong with it???

02-18-2007, 10:15 PM
I did a few more tests on the document in head statement but it did not matter were document.getElementById was it just worked -

I am workin with ie7 here, were you refering to an older version or other browsers ???

02-18-2007, 10:37 PM
Nope, I was referring to any browser in general... oh, and get Mozilla FireFox. Internet Explorer has a really un-standard reputation.

02-19-2007, 04:46 PM
Yeah, well I just can't do that :)

Because for one thing I did'nt know there was any browser out there then internet explorer, i only found out last year !!! And I am tooooo used to it, if i let go i won't be able to do everything i do now i mean I only know ie scripting (even though there all similar) i simply plan to keep it that way :)

02-19-2007, 11:31 PM
So can anyone help me with the animation part ???
Please? Stronger Please?:)