gewone link ipv option box

Pagina: 1
Acties:
  • 52 views sinds 30-01-2008

  • BlackShadow
  • Registratie: Februari 2002
  • Laatst online: 22:40
ik ben al een tijdje aan het klungelen met volgend script, ik zou graag de optionbox vervangen door gewone links, maar kom er niet aan uit, ik krijg altijd problemen bij

var selectedurl=document.jumpy.example.options[document.jumpy.example.selectedIndex].value

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<form name="jumpy">
<select name="example" size="1" onChange="gone()">
<!-- CHANGE THE BELOW URLS TO YOUR OWN-->
<option value="http://www.yahoo.com" selected>Yahoo.com</option>
<option value="http://www.google.com">Google</option>
<option value="http://www.lycos.com">Lycos</option>
<option value="http://www.AltaVista.com">AltaVista</option>
</select>

<input type="button" name="test" value="Go!" onClick="gone()">
</form>

<script language="javascript">
<!--

//Drop-down Document Viewer- © Dynamic Drive (www.dynamicdrive.com)
//For full source code, 100's more DHTML scripts, and TOS,
//visit http://www.dynamicdrive.com

//Specify display mode (0 or 1)
//0 causes document to be displayed in an inline frame, while 1 in a new browser window
var displaymode=0
//if displaymode=0, configure inline frame attributes (ie: dimensions, intial document shown
var iframecode='<iframe id="external" style="width:95%;height:400px" src="http://www.yahoo.com"></iframe>'

/////NO NEED TO EDIT BELOW HERE////////////

if (displaymode==0)
document.write(iframecode)

function gone(){
var selectedurl=document.jumpy.example.options[document.jumpy.example.selectedIndex].value
if (document.getElementById&&displaymode==0)
document.getElementById("external").src=selectedurl
else if (document.all&&displaymode==0)
document.all.external.src=selectedurl
else{
if (!window.win2||win2.closed)
win2=window.open(selectedurl)
//else if win2 already exists
else{
win2.location=selectedurl
win2.focus()
}
}
}
//-->
</script>

  • BlackShadow
  • Registratie: Februari 2002
  • Laatst online: 22:40
Op zondag 21 april 2002 17:27 schreef BlackShadow het volgende:
...
moet bij Programming & Webscripting blijkbaar, sorry voor het storen :)

  • McVirusS
  • Registratie: Januari 2000
  • Laatst online: 05-09 13:16
Op zondag 21 april 2002 17:31 schreef BlackShadow het volgende:

[..]

moet bij Programming & Webscripting blijkbaar, sorry voor het storen :)
Nee hoort toch hier :).

  • McVirusS
  • Registratie: Januari 2000
  • Laatst online: 05-09 13:16
En dit is trouwens gewoon basis HTML dus ehm....koop een HTML boek ofzo.

Dit topic is gesloten.