MM_jumpMenu delay modification - Can anyone help?

B

Bob Crisler

To better accommodate clients browsing by keyboard, I'd like to insert
a settimeout event into the MM_jumpMenu function to cause a two-second
delay before it executes. Have tried it a few ways, but no luck. The
MM_jumpMenu script in question:

<script language="JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
 
J

Janwillem Borleffs

Bob said:
To better accommodate clients browsing by keyboard, I'd like to insert
a settimeout event into the MM_jumpMenu function to cause a two-second
delay before it executes. Have tried it a few ways, but no luck. The
MM_jumpMenu script in question:

<script language="JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0


eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0; } //-->
</script>

<script type="text/javascript">

function MM_jumpMenu(targ,selObj){

setTimeout(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"
, 2000);
}

</script>


JW
 
B

Bob Crisler

Thank you, Janwillem.

I tried the code, and while it does pause before taking the user to
the site referenced in the select meny, it also deletes any reference
of the referring page in the browser history. (Is that what the 'eval'
and 'if' in the original script accomplish?)

Bob Crisler
Ashland, NE USA


Janwillem Borleffs said:
Bob said:
To better accommodate clients browsing by keyboard, I'd like to insert
a settimeout event into the MM_jumpMenu function to cause a two-second
delay before it executes. Have tried it a few ways, but no luck. The
MM_jumpMenu script in question:

<script language="JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0


eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0; } //-->
</script>

<script type="text/javascript">

function MM_jumpMenu(targ,selObj){

setTimeout(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"
, 2000);
}

</script>


JW
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top