Closed Thread Icon

Preserved Topic: dHTML Help with classes PLEASE! Pages that link to <a href="https://ozoneasylum.com/backlink?for=17758" title="Pages that link to Preserved Topic: dHTML Help with classes PLEASE!" rel="nofollow" >Preserved Topic: dHTML Help with classes PLEASE!\

 
Author Thread
foam
Bipolar (III) Inmate

From: Fontana, Ca, USA
Insane since: Jun 2000

posted posted 06-12-2000 18:29

HEy, I need some help guys.

This page www.panzone.com/foam/dynamics/

i cant get the javascript to work with the object 'dynam'

I have told it thru CSS what dynam is, but it wont work.

Someone please tell me how i can define dynam so i can do something like

dynam.style.left = -=5

thanks guys...

if you still dont understand, check the page, and view the source.

Scott
www.thefoam.org

foam
www.thefoam.org

WarMage
Maniac (V) Mad Scientist

From: Rochester, New York, USA
Insane since: May 2000

posted posted 06-12-2000 20:20

The problem may be that you didn't make the object. makeObj or what not. not 100% sure.

Slime
Lunatic (VI) Mad Scientist

From: Massachusetts, USA
Insane since: Mar 2000

posted posted 06-12-2000 21:11

In IE, you need to use ...style.pixelLeft, not ...style.left . the regular "left" property, in IE, is supposed to be set to a string value, I beleive, such as "-5px" - the thing that you would actually set the style sheet to.

That may not be it, though.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 06-13-2000 22:43

Ok two things,

First you have the dynam ID in the IMG tag, thats hosing stuff, cuz the browser doesn't know whether you are refrencing the DIV or the image, you need to take that out. Then if you are going to move stuff this way you need to initialize the starting points you can do it with a function like this:

function init(){
if (document.layers){
document.dynam.left = 162;
}
if(document.all){
document.all.dynam.style.left = 162;
}
moveIt();
}

then what you want to do is call that function in the Body onLoad tag. Then it should work.

Have troubles? I put a working version up at www.bitdamaged.com/testpages/foam/
I added a few things like the way to recognize netscape and IE in that code you may want to see how it works it'll save you some typing.

WarMage you are right more advanced scripters like to create Javascript objects which they can manipulate but this is not necessary and a bit difficult sometimes.

anyway there ya go
bit


Walking the Earth like Kane

[This message has been edited by bitdamaged (edited 13-06-2000).]

[This message has been edited by bitdamaged (edited 14-06-2000).]

« BackwardsOnwards »

Show Forum Drop Down Menu