Avatar billede bjarte Nybegynder
08. november 1999 - 13:25 Der er 1 løsning

tja...jeg trenger hjeeeeeeeeeeeelp!!

http://www.eksperten.dk/spm.asp?id=6641

jeg trenger hjelp med det som er på denne link.

Avatar billede hirtshals Nybegynder
08. november 1999 - 13:31 #1
Her finder du den hjelp jeg tror du trenger

http://www.echoecho.com/jsdropdown.htm


THE SCRIPT:
To make this script work on your page you need to add it to the head-section of your document.

Next you need to add onChange="DropDownMenu(this)" to each drop-down-menu that should call the script.

The onChange is added to the <select>-tag of the desired drop-down-menu.

Finally you need to add the desired URL and the optional target to each of the options in the menus.

To do this use the following syntax:

<option value="http://www.yahoo.com">Yahoo</option>

If you want to add a target to the link use this syntax:

<option value="http://www.yahoo.com&target">Yahoo</option>

where target is replaced by the target you want to use.
If, say, you wanted the link to open in a frame called "main" you would add:

<option value="http://www.yahoo.com&main">Yahoo</option>

Note:
You can also use the reserved targets:

"_blank"
"_top"
"_parent"
"_self"
Click here to get an explanation of these targets.

Finally you can enter FALSE in the URL-field to let the script know that the option shouldn't load a page.
This is what you will do if you want one of the options to be a header for the drop-down-menu
-  like for example "SEACH-ENGINES" and "THIS SITE" in the two examples shown at the top of this page.

The script looks like this:

<script>
function DropDownMenu(entered)
{
// ***************************************************************************
// DROP DOWN MENU (c) Henrik Petersen / NetKontoret 1998 - All rights reserved
// Explained along with other useful scripts at: http://www.echoecho.com/javascript.htm
// You may freely use this script as long as you do not remove this line and the 2 lines above.
// ***************************************************************************
with (entered)
{
// Store the selected option in a variable called ref
ref=options[selectedIndex].value;
// Count the position of the optional &
splitcharacter=ref.lastIndexOf("&");

// The three lines below checks if a target goes along with the URL
// That is: (if a "&" is in the option-value).
// If so, the URL is stored in a variable called loc and the target
// is stored in a variable called target.
// If not the URL is stored in a variable called loc and "_self" is
// stored in the variable called target.
if (splitcharacter!=-1) {loc=ref.substring(0,splitcharacter);  target=ref.substring(splitcharacter+1,1000).toLowerCase();}
else {loc=ref; target="_self";};

// create a varible called lowloc to store loc in lowercase characters.
lowloc=loc.toLowerCase();

//  Skip the rest of this function if the selected optionvalue is "false".
if (lowloc=="false") {return;}

// Open link in current document
if (target=="_self") {document.location=loc;}

// Cancel eventual framesets and open link in current window
else {if (target=="_top") {top.location=loc;}

// Open link in new window
else {if (target=="_blank") {window.open(loc);}

// Open link in parent frame
else{if (target=="_parent") {parent.location=loc;}

// Open link in the specified frame
else {parent.frames[target].location=loc;};
}}}}
}
</script>

Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester