I finally got everything to work, by using window.setInterval(); to start calling a function that moves the div off the screen by 5px untill it reached 1000 px.
The problem is that in Firefox the div will stop in place and not move but when you click another window, you can see it moving in the background fine. This is really weird.
I was wondering if there is a better way than changing the x coord of a div other than the style.left = with css?
not sure if this helps but here is the code:
Expand|Select|Wrap|Line Numbers
- var b = browserCheck();
- var moveID = 0;
- var win = window.self;
- var gcDiv,glDiv,grDiv,off;
- function setVars(){
- gcDiv = MM_findObj('greenCover');
- glDiv = MM_findObj('greenleft');
- grDiv = MM_findObj('greenright');
- off = gcDiv.offsetLeft;
- }
- function moveToRight(){
- if(glDiv.style.display != 'block'){glDiv.style.display = 'block';};
- if(off < 1000){
- off = off + 5; gcDiv.style.left = off + "px";
- }else{gcDiv.style.display = "none"; win.clearInterval(moveID);}
- //document.getElementById("output").innerHTML = gcDiv.style.left;
- }
- function int_moveToRight(){
- moveID = win.setInterval(moveToRight, 10);
- }