LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   javascript change div position? (https://www.linuxquestions.org/questions/programming-9/javascript-change-div-position-441601/)

ati 05-04-2006 11:38 AM

javascript change div position?
 
hi all

got a small problem i manged to get the positions changed of the div tags, it works perfectly on opera but not firefox, any ideas why?

here is my javascript:

Code:

function anime1(anime) {
//10 secs delay
setTimeout('anime()',10000)
}
function anime(a) {

//get div elemnts
document.getElementById("a").style.top=370;
document.getElementById("b").style.top=390;
document.getElementById("c").style.top=410;
document.getElementById("c2").style.top=250;
document.getElementById("d").style.top=350;
document.getElementById("e").style.top=430;
document.getElementById("f").style.top=270;
document.getElementById("g").style.top=310;
document.getElementById("h").style.top=290;
document.getElementById("i").style.top=330;
document.getElementById("j").style.top=450;

}

the webdeveloper extension is giving me this javascript error:

Error: Error in parsing value for property 'top'. Declaration dropped.

thanks for looking and ur time

ati 05-04-2006 01:06 PM

i have slightly improved the code to see if that would do anything, but no opera still renders it and firefox dont. any ideas would be very grateful.


Code:

function anime1(anime) {
//10 secs delay
setTimeout('anime()',10000)
}
function anime(a) {



document.getElementById("a").style.top = "370 px";
document.getElementById("b").style.top = "390 px";
document.getElementById("c").style.top = "410 px";
document.getElementById("c2").style.top = "250 px";
document.getElementById("d").style.top = "350 px";
document.getElementById("e").style.top = "430 px";
document.getElementById("f").style.top= "270 px";
document.getElementById("g").style.top= "310 px";
document.getElementById("h").style.top= "290 px";
document.getElementById("i").style.top= "330 px";
document.getElementById("j").style.top= "450 px";

}

:mad:

ati 05-04-2006 01:31 PM

http://img421.imageshack.us/my.php?i...titled15ro.gif


below is the foloowing error in firefox

thanks

ati 05-05-2006 03:29 AM

thanks you all for lloking i managed to fix it was few syntax errors


All times are GMT -5. The time now is 10:52 PM.