[ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذه الصورة] القائمة التي تسمح للمستخدم بإجراء تحديد مباشرة عن طريق اختيار الخيار الذي ترغب في الذهاب إليه
[ندعوك للتسجيل في المنتدى أو التعريف بنفسك لمعاينة هذه الصورة] كود
<head>
<script type="text/javascript">
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>
</head>
<body>
<form>
<select id="webdevlinks" size="6" onChange="animatedList.navigate('webdevlinks')">
<option value="http://www.yahoo.com">الياهو</option>
<option value="http://www.google.com">جوجل</option>
</select>
</form>
<form>
<select id="newslinks" size="1" onChange="animatedList.navigate('newslinks')">
<option value="https://zaharatb.yoo7.com/">منتدى</option>
<option value="https://zaharatb.yoo7.com/portal">البوابة</option>
</select>
</form>
</body>