Click to See Complete Forum and Search --> : NS7 and DHTML, ala, it doesn't work???


A2597
03-27-2003, 08:48 PM
I'm working on a website, for one of the effects I needed to use some DHTML. The effect is a simple image move, from off screen to the upper left corner. It works perfectly in IE6, and NS4, but not in NS7.

I can't figure out why, and I need to get this done ASAP.

example page with the code:
http://www.the-glass-goddess.com/contact.html

the function are located in http://www.the-glass-goddess.com/gg.js

all help is greatly appreciated!

A2597
03-28-2003, 01:40 PM
that helped alot, it not works in NS7!!!

now there is another problem, it used to move from left to right, no verticle movment...
now it moves diaganally, and I can't figure out why. :(

help! (Uploaded new versions)

khalidali63
03-28-2003, 02:36 PM
you will have to change the code according DOM standards for NS6+ to do that.
to reference an element
object = document.getelementById("elementId")
and to make it move
X axis
object.style.left = "new postiotion"
Y axis
object.style.top = "new postiotion"

the above 2 lines of code work for both IE and NS6+

Hope this helps

Cheers

Khalid

A2597
03-28-2003, 03:01 PM
Originally posted by khalidali63
you will have to change the code according DOM standards for NS6+ to do that.
to reference an element
object = document.getelementById("elementId")
and to make it move
X axis
object.style.left = "new postiotion"
Y axis
object.style.top = "new postiotion"

the above 2 lines of code work for both IE and NS6+

Hope this helps

Cheers

Khalid

*sigh* now I REALLY showing how little I know...
where exactly do I change this, in the html file, or the "shiftIt" command in the .js file?

thanks!

khalidali63
03-29-2003, 11:35 AM
post your code here( preferably both .js and html that calls functions)
SO tha some one can take a look and guide you through.

Cheers

Khalid

A2597
03-29-2003, 11:38 AM
heh, I *just* found the error:

function shiftIt(id, dx, dy) {
var object=getObject(id);
if (isDOM) {
object.style.left=parseInt(object.style.left)+dx;
object.style.top=parseInt(object.style.left)+dy;
}
else if (isNS) {
object.moveBy(dx, dy);
} else if (isIE) {
object.pixelLeft=object.pixelLeft+dx;
object.pixelTop=object.pixelTop+dy;
}
}

Seems so obvious now, but I looked though that code more times....*sigh* Thanks for all your help guys!