Web Advertising - Self Improvement Articles Directory - Business Gifts - Car Insurance Quotes - Spanish Property

PDA

View Full Version : I need a way to maintain moved div positions when the page reloads


tmg
Jan 27th 2008, 9:46 pm
I have the following functions on my website and need a way to maintain the moved div positions when the user loads another page or reloads the current page. I have looked at various cookie codes available online and tried (without any luck) to adapt them. I am fairly new to javascript, but know just enough that I managed to piece together the functions below from various code snippets available online. Can anyone help, or point me in the right direction?

Thanks in advance-
Teri

view test page here -
http://www.artsitedesign.com/teri/bp_iceas3.cfm

below is my moveObject funtion, the second function moves the divs back to their original position. Both are called with onClick.

function moveObject(){
var object=document.getElementById('todobox');
object.style.position='absolute';
object.style.top=0 + 'px';
object.style.left=0 + 'px';
var object=document.getElementById('contentbox');
object.style.position='absolute';
object.style.top=1 + 'px';
object.style.left=400 + 'px';
object.style.textAlign='left';
}

function MM_moveObject(){
var object=document.getElementById('todobox');
object.style.position='absolute';
object.style.top=0 + 'px';
object.style.left=-400 + 'px';
var object=document.getElementById('contentbox');
object.style.position='absolute';
object.style.top=1 + 'px';
object.style.left=0 + 'px';
object.style.textAlign='center';
}
Thanks Edit/Delete Message

ltdraper
Feb 1st 2008, 5:47 am
Store the positions in <INPUT type="hidden"> variables. Update their values when you move the divs. Move the div to the hidden values wen the page loads.

Or am I missing something in your question?