...

View Full Version : MM_jumpMenu with FF



ZORBEC
05-14-2005, 05:37 PM
Hi
I use MM_jumpMenu in the frame :
It's works well with IE-6 & OPERA-8,
but nothing with FIRE FOX...
Any Idea ? :thumbsup:

want to see the website ... Menu on the top left.
http://www.bluafghan.com

........................................
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
...................................
<td valign="middle">
<a href="../imagalea/imagalea.htm" target="details">
<select name="menu1" onChange="MM_jumpMenu('parent.frames[\'details\']',this,0)" size="5" style="font-family: Comic Sans MS; font-size: 8pt; color: #663300">
<option selected value="../imagalea/imagalea.htm">BIENVENUE SUR WWW.BLUAFGHAN.COM</option>
<option value="../menus/annonces.htm">Le Coin des Naissances</option>
<option value="../menus/infos.htm">Informations Générales</option>
<option value="../menus/afghans.htm">Photos Afghans</option>
<option value="../menus/salukis.htm">Photos Salukis</option>

<!--<option value="../links/eleveurs.htm">Les Eleveurs</option>-->
<option value="../../chiens/dev/dogene/LIST_ELEVAGES.php">Les Eleveurs</option>
<option value="../calendrier/racing-pvl.htm">Calendrier des Epreuves de Travail</option>
<option value="../webmasters/webmasters.htm">Webmasters</option>
</select></a>
</td>

...........................................................

Single Paradox
05-14-2005, 08:31 PM
To me.. that seems like a lot of not needed code. What I do for my drop downs are:

<script>

function FastLink() {

window.location= document.getElementById('yourSelectIdHere').value;
}
</script>

<select onchange="FastLink();" id="yourSelectIdHere">
<option value="http://wwww.google.com">Google</option>
<option value="http://wwww.Msn.com">Msn</option>
<option value="http://wwww.codingforums.com">Coding forums</option>
</select>

glenngv
05-16-2005, 05:18 AM
Or do not pass the first argument as string but the object itself to avoid the use of the dreaded eval (http://www.codingforums.com/showthread.php?t=20143).


function MM_jumpMenu(targObj,selObj,restore){ //v3.0
targObj.location=selObj.options[selObj.selectedIndex].value;
if (restore) selObj.selectedIndex=0;
}
...
onChange="MM_jumpMenu(parent.frames['details'],this,0)"

Always check the Javascript Console to see if there's an error or not.

ZORBEC
05-17-2005, 10:10 AM
Thanks Glenngv & Single Paradox for these scripts but.... it's still the same.
I tried them and they doesn't works with the FireFox 1.03...
All is ok with IE-6, Nescape-6, Opera-8.
I don't understand.
Thanks ;)

glenngv
05-17-2005, 10:20 AM
I visited your site and it works for me in FF 1.0.4. The corresponding page is displayed in the main frame when an option item is selected.

Is there any error in Javascript console? Can you describe what happens in FF 1.0.3 instead of saying "doesn't work in Firefox"?

ZORBEC
05-17-2005, 11:22 AM
there is no error in the Javascript console.
The problem is with FF-1.03 , that when I select a link in the menu
the corresponding page is not displayed in the main frame .

It's again and again the first page.

I'am going to find the 1.04 Version of FF.
Thanks again. :rolleyes:

glenngv
05-17-2005, 02:09 PM
Are you sure Javascript is not disabled? I see nothing that will cause it not to work.

ZORBEC
05-17-2005, 05:58 PM
I loaded FF 1.04, still the same effect.
Javascript is actived , and each time i click on a link, the main page is regenerated and the aleatoire dog's picture on the right side change every time, but not showing the linked page.

I think about my system a little bite OLD.. win98.
Or maybe the programming , which is not like W3C would like it...

Anyway I will find a solution for this problem and I'll try with XP first, otherwise I'll rewrite the script without those bloody frames.

Friendly
Guy Chouquet :(

glenngv
05-18-2005, 04:58 AM
Now I see what's wrong when I tried it in IE6. I thought Firefox displays the corresponding page when an option is selected. But if you come to think of it, Firefox just does what you tell it to do. You have <select> tag inside an <a> tag! :eek:

<a href="../imagalea/imagalea.htm" target="details"><select name="menu1" ...>...</select></a>

That causes any click in the select tag to serve as the click to that link.
Why do you have that?? :confused:

If you remove the <a> tag, i'm sure it will make all browsers happy.

ZORBEC
05-20-2005, 04:39 PM
thanks Glenn...
I did it and it's ok
:thumbsup:

tigerlily
05-01-2007, 04:57 PM
I like your code here...
<script>

function FastLink() {

window.location= document.getElementById('yourSelectIdHere').value;
}
</script>

<select onchange="FastLink();" id="yourSelectIdHere">
<option value="http://wwww.google.com">Google</option>
<option value="http://wwww.Msn.com">Msn</option>
<option value="http://wwww.codingforums.com">Coding forums</option>
</select>


...and would like to know how to make it dynamic so you can have mulitiple drop down lists on one page without making a new function for each. It seems like it should be easy to do, but I am drawing a blank today. Newbie to JS.

glenngv
05-01-2007, 05:26 PM
function FastLink(url) {
if (url!="") location.href = url;
}


<select onchange="FastLink(this.value);" id="yourSelectIdHere">
<option value="">--Select Site--</option>
<option value="http://wwww.google.com">Google</option>
<option value="http://wwww.Msn.com">Msn</option>
<option value="http://wwww.codingforums.com">Coding forums</option>
</select>

<select onchange="FastLink(this.value);" id="yourSelectIdHere2">
<option value="">--Select Site--</option>
<option value="http://wwww.yahoo.com">Yahoo</option>
<option value="http://wwww.cnn.com">CNN</option>
</select>

tigerlily
05-01-2007, 08:30 PM
This is what I have right now using his example as a base (actually I have four different drop downs on this page, here are two)...


<script language="JavaScript">
<!--
function FastLink1() {
window.location= document.getElementById('Select1').value;
}
//-->
<!--
function FastLink2() {
window.location= document.getElementById('Select2').value;
}
//-->
</script>

<select name="accountlist" onchange="FastLink1();" id="Select1">
<cfoutput>
<option value="filename.cfm?all=go" <cfif isDefined("url.all")>SELECTED</cfif>>ALL</option>
</cfoutput>
<cfloop index="i" list="#variables.allaccounts#" delimiters=",">
<cfoutput>
<option value="filename.cfm?account=#variables.i#" <cfif #variables.i# is #variables.Account#>SELECTED</cfif>>#variables.i#</option>
</cfoutput>
</cfloop>
</select>
<select name="PerPage" onchange="FastLink2();" id="Select2">
<cfloop index="DDList" list="#Variables.DDList#" delimiters=",">
<cfif #URL.MaxRows# IS "#DDList#">
<cfoutput>
<option selected value="filename.cfm?account=#variables.Account&MaxRows=#variables.DDList#">#variables.DDList# Per Page</option>
</cfoutput>
<cfelse>
<cfoutput>
<option value="filename.cfm?account=#variables.Account&MaxRows=#variables.DDList#">#variables.DDList# Per Page</option>
</cfoutput>
</cfif>
</cfloop>
</select>

Are you saying that I don't need the ID in the select tag either? Just the "this.value" inside the () in the onchange=FastLink()? So, it would look like this...

<script language="JavaScript">
<!--
function FastLink(url) {
if (url!="") location.href = url;
}//-->
</script>

<select name="accountlist" onchange="FastLink(this.value);">
<cfoutput>
<option value="filename.cfm?all=go" <cfif isDefined("url.all")>SELECTED</cfif>>ALL</option>
</cfoutput>
<cfloop index="i" list="#variables.allaccounts#" delimiters=",">
<cfoutput>
<option value="filename.cfm?account=#variables.i#" <cfif #variables.i# is #variables.Account#>SELECTED</cfif>>#variables.i#</option>
</cfoutput>
</cfloop>
</select>
<select name="PerPage" onchange="FastLink(this.value);">
<cfloop index="DDList" list="#Variables.DDList#" delimiters=",">
<cfif #URL.MaxRows# IS "#DDList#">
<cfoutput>
<option selected value="filename.cfm?account=#variables.Account&MaxRows=#variables.DDList#">#variables.DDList# Per Page</option>
</cfoutput>
<cfelse>
<cfoutput>
<option value="filename.cfm?account=#variables.Account&MaxRows=#variables.DDList#">#variables.DDList# Per Page</option>
</cfoutput>
</cfif>
</cfloop>
</select>

I need this to work whether there is one drop down or twenty.
Thanks for your help! :)

tigerlily
05-01-2007, 08:52 PM
That worked!!! You are awesome and quick. Very Cool, thanks! :D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum