Gepost op 16 mei 2021
Select & Copy <script type="text/javascript"> /*********************************************** * Animated Random Option Combo- by JavaScript Kit (www.javascriptkit.com) * This notice must stay intact for usage * Visit JavaScript Kit at http://www.javascriptkit.com/ for this script and 100s more ***********************************************/ var animatedList={ navigate:function(selectId){ this.selectObj=document.getElementById(selectId) window.location=this.selectObj[this.selectObj.selectedIndex].value }, randomizeInit:function(selectId){ this.selectObj=document.getElementById(selectId) this.curframe=0 this.optionscount=this.selectObj.options.length //calculate number of frames to animate (cycle through options before settling on one) this.maxframes=Math.floor(Math.random()*this.optionscount)+Math.floor(Math.random()*this.optionscount) this.randomize() }, randomize:function(){ if (this.curframe<this.maxframes) this.selectObj.selectedIndex=this.settledIndex=(this.curframe<this.optionscount)? this.curframe : this.curframe-this.optionscount else{ //settle on and select this option this.selectObj.selectedIndex=(this.selectObj.selectedIndex==-1)? this.settledIndex : -1 } this.curframe++ if (this.curframe<this.maxframes+4) //Keep running this function until "maxframes" cycle plus 4 (4 being cycle for highlighting selected option) setTimeout("animatedList.randomize()", 100) else window.location=this.selectObj[this.selectObj.selectedIndex].value } } </script>
Select & Copy <form> <select id="newslinks" size="1" onChange="animatedList.navigate('newslinks')"> <option value="#">Volgende website</option> <option value="https://tooljunkie.eu">Tooljunkie</option> <option value="https://wichhart.nl">Wichhart</option> <option value="https://detheorist.nl/">De Theorist</option> <option value="https://ultrasarnhem.nl/">Ultras Arnhem</option> <option value="https://sintenpietontour.nl">Sint en Piet</option> <option value="https://velpzuid.nl">Velp-Zuid</option> <option value="https://vzphiphop.nl">VZP</option> <option value="https://theo4ever.nl">Theo4ever</option> <option value="https://dikkelol.nl/">Dikke lol</option> <option value="https://studiovianova.nl">Studio ViaNova</option> <option value="https://alternatievesocialmedia.nl/">ASM</option> <option value="https://tooljunkie.eu/">Tooljunkie</option> </select> <input type="button" onClick="animatedList.navigate('newslinks')" value=">" /> <input type="button" onClick="animatedList.randomizeInit('newslinks')" value="Random" /> </form>
Tags: JS Javascript HTML
🔙 Terug
Nieuwe website
Gebruikersnaam:
Wachtwoord:
Account maken!Wachtwoord vergeten?Wat is mijn gebruikersnaam?