[thelist] Simple code help for DHTML & thanks
Duncan O'Neill
dbaxo at ihug.co.nz
Wed Sep 13 16:45:18 CDT 2000
Hey all,
I'm trying to write a couple of lines of code for cross-browser
DHTML so I can move the different DIVS about. My problem is getting
the code right for NN4.X. I've been playing around with this for
way too long, but I can't seem to get it right. Could anyone
either A) tell me what's wrong with the code below or B) give me a
(simple) generic code I can plug in which will work for both
version 4 browsers, or point me to a simple code which will do the
trick....For your amusement, this is what I've tried so far;
This works for one DIV;
function moveIt(){
if(document.layers)
{
daPic = document.pic
}
else if(document.all)
{
daDiv =pic.style;
}
daPic.left = parseInt(daPic.left) - 25; ETC, ETC...........
}
==================================================================
but when I try to use parameters to plug more than one DIV in,
Navigator won't do it.
when I try this I get an error......
function moveIt(which_div){
if(document.layers)
{
daDiv = document.which_div
}
else if(document.all)
{
daDiv = which_div.style;
}
.....etc,
}
===============================================================
and this code gives me no errors, but I can't figure out how
to plug it in;
function moveIt(which_div){
if(document.layers)
{
daDiv = document.layers['which div'];
}
else if(document.all)
{
daDiv = which_div.style;
}
blah,blah
}
Any help gratefully received.
Cheers,
=====================================================
Duncan O'Neill
The Urban Legend magazine
=====================================================
More information about the thelist
mailing list