Forum Moderators: open

Message Too Old, No Replies

something strange with reload

reload works, but next function dead

         

ctoz

10:04 am on Dec 21, 2009 (gmt 0)

10+ Year Member



Hi,

I have a front pane which starts with a welcome message. Mouseover the welcome and the main menu drops down (script).

I want to the viewer to be able to return to the front pane via a link and when returned, to have the menu already dropped down and available.

Sounds straightforward—run reload function, and delay the dropdown function—but the reload function seems to be stopping the dropdown function from running at all. Not getting any error messages either.

Any ideas?

Reload:
function reLoad() {
window.location.reload(true); // or just .reload()
}

Drop the menu (reveals links progressively):
dropMenu() {
onD('MBR');
setTimeout('onV(\'enq\')',400);
setTimeout('onV(\'browse\')',800);
setTimeout('onV(\'notes\')',1200);
setTimeout('onV(\'bones\')',2000); return false;
}

Putting them together:
onclick="reLoad(); setTimeout('dropMenu()', 400);"

//ends

daveVk

5:57 am on Dec 22, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Reload causes the current document to be unloaded, and a new document to be loaded. Javascript (and pending timeouts) running at the time of the unload are assumably terminated.

I want to the viewer to be able to return to the front pane via a link and when returned, to have the menu already dropped down and available.

Consider using a different url eg www.example.com?menu=open or set a cookie to indicate menu required before href actioned.

ctoz

12:59 am on Dec 28, 2009 (gmt 0)

10+ Year Member



Thanks Dave for explaining. First solution is within my present knowledge; will have a look at cookies as well.