Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 14 of 14
  1. #1
    New to the CF scene
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    MM_jumpMenu with FF

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

    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>

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

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    525
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>
    Single Paradox
    My Site (Under construction)

    Not too bad for a 15 year old

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Or do not pass the first argument as string but the object itself to avoid the use of the dreaded eval.

    Code:
    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.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #4
    New to the CF scene
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    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"?
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #6
    New to the CF scene
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #7
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Are you sure Javascript is not disabled? I see nothing that will cause it not to work.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #8
    New to the CF scene
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #9
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    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!

    <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??

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

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #10
    New to the CF scene
    Join Date
    May 2005
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks Glenn...
    I did it and it's ok

  • #11
    New to the CF scene
    Join Date
    May 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #12
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Code:
    function FastLink(url) {
      if (url!="") location.href = url;
    }
    Code:
    <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>
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #13
    New to the CF scene
    Join Date
    May 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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!

  • #14
    New to the CF scene
    Join Date
    May 2007
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That worked!!! You are awesome and quick. Very Cool, thanks!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •