| |
[ 01. September 1999]
- Martin_Nemecek
Pulldown menu a tabu╛ka odkazov
Pull down scripty tvoria ve╛mi d⌠le₧it· s·Φas¥ JavaScriptu a s· ve╛mi Φasto vyu₧φvanΘ pri tvorbe strßnok.
Dnes si ukß₧eme pßr pull down menu, ktorΘ nßm bud· sl·₧i¥ ako "linkov² rozcestnφk"na naÜich strßnkach.
V²ber nΘhodnΘho linku
Nasleduj·ci script nßm demonÜtruje jednoduchΘ okno,v ktorom s· umiestnenΘ jednotlivΘ linky.
<script>
/*
Developer Zone - www.developer.sk / JavaScript
*/
var count=0
function dothis(){
setTimeout("document.wheel.wheel2.selectedIndex =1000",100)
setTimeout("document.wheel.wheel2.selectedIndex =count",200)
setTimeout("document.wheel.wheel2.selectedIndex =1000",300)
setTimeout("document.wheel.wheel2.selectedIndex =count",400)
setTimeout("document.wheel.wheel2.selectedIndex =1000",500)
setTimeout("document.wheel.wheel2.selectedIndex =count",600)
setTimeout("window.location=document.wheel.wheel2.options
[document.wheel.wheel2.selectedIndex].value",800)
}
function animate(){
var countfinal=
Math.round(Math.random()*(document.wheel.wheel2.length-1))
document.wheel.wheel2.selectedIndex =count
if (count==countfinal){
dothis()
return
}
if (count<document.wheel.wheel2.length)
count++
else
count=0
setTimeout("animate()",50)
}
</script>
<form method="POST" name="wheel">
<div align="center"><center><p><select name="wheel2" size="8">
<option value="http://www.developer.com">Developer.com</option>
<option value="http://www.cnn.com">CNN</option>
<option value="http://www.developer.sk">Developer.sk</option>
<option value="http://www.developer.cz">Developer.cz</option>
<option value="http://www.builder.com">
Builder.com</option>
</select></p>
</center></div><div align="center"><center><p><input type="
button" value="Vyber Site"
name="B1" onClick="animate()"></p>
</center></div>
</form>
V²sledn² script:
Pulldown Menu 1
Tento script, ktor² je umiestnen² pod t²mto textom, ktor² Φφtate, je ukß₧kou klasickΘho pulldown menu, ktorΘho zdrojov² k≤d sa vojde na
pßr riadkov. PredovÜetk²m je potrebnΘ si zadefinova¥ v tele scriptu :
<script language="JavaScript> , funkciu
function surfto(form) , ktorß nßm zabespeΦφ v definovanom combo boxe redirekciu dan²ch linkov.
|
|
| |
|
|