微调器应用

编程入门 行业动态 更新时间:2024-10-25 12:22:07
本文介绍了微调器应用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好 我有随机播放功能,可以随机排列数组中的数据,并且可以按列在表中显示数组值.通过单击事件,必须对表中的值进行混洗,然后再次将其显示在表中. 随机播放功能代码在这里

Hi All I have shuffle function with me which shuffles data in an array and I am displaying the array values in a table along column-wise. By an on click event the values in the table has to be shuffled and again they have to be displayed in the table. Shuffle function code is here

function shuffle() { var randomNumber; var len=this.length-1; randomNumber = Math.floor(Math.random()*len); // document.write(randomNumber); if(randomNumber > len) { randomNumber =len; } for(var i =0; i <= randomNumber; i++) { if(i !=len) { this[i] = this[i+1]; } else { temp =this[i]; this[i]=this[0]; this[0]=temp ; } } }

我已经使用了如下所示的随机播放功能

and i have used this shuffle function as below

function autoSpin() { //var Date.monthNames = new Array('Active','Passive','Bargain','Vegas','Value'); months.shuffle(); var shuffleresults= Date.monthNames.join("br<>"); var len = shuffleresults.rows.length, i; if(shuffleresults.rows.length > 0) { alert("hi"); Date.monthNames[0] = shuffleresults.rows.item[0].Date.monthNames[0]; Date.monthNames[1] = shuffleresults.rows.item[1].Date.monthNames[1]; Date.monthNames[2] = shuffleresults.rows.item[2].Date.monthNames[2]; Date.monthNames[3] = shuffleresults.rows.item[3].Date.monthNames[3]; Date.monthNames[4] = shuffleresults.rows.item[4].Date.monthNames[4]; //spinnerId = shuffleresults.rows.item[0].spinnerId; } document.getElementById('Date.monthNames[0]').innerHTML = Date.monthNames[0]; document.getElementById('Date.monthNames[1]').innerHTML = Date.monthNames[1]; document.getElementById('Date.monthNames[2]').innerHTML = Date.monthNames[2]; document.getElementById('Date.monthNames[3]').innerHTML = Date.monthNames[3]; document.getElementById('Date.monthNames[4]').innerHTML = Date.monthNames[4]; Date.dayNames.shuffle(); //var Date.dayNames=new Array('LEAPS','Earnings','Economic','Weekly','Daily'); var shuffleresults1= Date.dayNames.join("<br>"); var len = shuffleresults1.columns.length, i; if(shuffleresults1.columns.length > 0) { Date.dayNames[0] = shuffleresults1.columns.item[0].Date.dayNames[0]; Date.dayNames[1] = shuffleresults1.columns.item[1].Date.dayNames[1]; Date.dayNames[2] = shuffleresults1.columns.item[2].Date.dayNames[2]; Date.dayNames[3] = shuffleresults1.columns.item[3].Date.dayNames[3]; Date.dayNames[4] = shuffleresults1.columns.item[4].Date.dayNames[4]; } //spinnerId = shuffleresults1.columns.item[0].spinnerId; document.getElementById('Date.dayNames[0]').innerHTML = Date.dayNames[0]; document.getElementById('Date.dayNames[1]').innerHTML = Date.dayNames[1]; document.getElementById('Date.dayNames[2]').innerHTML = Date.dayNames[2]; document.getElementById('Date.dayNames[3]').innerHTML = Date.dayNames[3]; document.getElementById('Date.dayNames[4]').innerHTML = Date.dayNames[4]; //var Date.yearNames=new Array('2$','1$','50 cents','25 cents','5 cents'); Date.yearNames.shuffle(); var shuffleresults2= Date.yearNames.join("<br>"); var len = shuffleresults2.columns.length, i; if(shuffleresults2.columns.length > 0) { Date.yearNames[0] = shuffleresults2.columns.item[0].Date.yearNames[0]; Date.yearNames[1] = shuffleresults2.columns.item[1].Date.yearNames[1]; Date.yearNames[2] = shuffleresults2.columns.item[2].Date.yearNames[2]; Date.yearNames[3] = shuffleresults2.columns.item[3].Date.yearNames[3]; Date.yearNames[4] = shuffleresults2.columns.item[4].Date.yearNames[4]; //spinnerId = shuffleresults2.rows.item[0].spinnerId; } document.getElementById('Date.yearNames[0]').innerHTML = Date.yearNames[0]; document.getElementById('Date.yearNames[1]').innerHTML = Date.yearNames[1]; document.getElementById('Date.yearNames[2]').innerHTML = Date.yearNames[2]; document.getElementById('Date.yearNames[3]').innerHTML = Date.yearNames[3]; document.getElementById('Date.yearNames[4]').innerHTML = Date.yearNames[4]; }

有关参考,请访问网址 www.urbanspoon/spin-widget [ ^ ]对于该应用程序中的旋转按钮,我使用了带有autoSpin()函数的on click事件并且我已经定义了上面的函数.此处显示的数组是Date.monthNames,Date.dayNames,Date.yearNames,请检查此一项,如果发现任何错误,请返回给我. 在此先感谢

For reference please visit the url www.urbanspoon/spin-widget[^] for the spin button in that application i have used an on click event with function autoSpin() and i have defined the function above.The arrays displayed here are Date.monthNames, Date.dayNames, Date.yearNames please check this one and if you find any errors please revert back to me. Thanks in advance

推荐答案

','1

','50美分','25美分','5美分'); 日期 .yearNames.shuffle(); var shuffleresults2 = 日期 .yearNames.join(" 有关参考,请访问网址 www.urbanspoon/spin-widget [ ^ ]对于该应用程序中的旋转按钮,我使用了带有autoSpin()函数的on click事件并且我已经定义了上面的函数.此处显示的数组是Date.monthNames,Date.dayNames,Date.yearNames,请检查此一项,如果发现任何错误,请返回给我. 预先感谢

For reference please visit the url www.urbanspoon/spin-widget[^] for the spin button in that application i have used an on click event with function autoSpin() and i have defined the function above.The arrays displayed here are Date.monthNames, Date.dayNames, Date.yearNames please check this one and if you find any errors please revert back to me. Thanks in advance

如果您打算演示一些有用的功能,那么这是错误的论坛. 请从此处删除它,并将其发布在提示与操作"中.技巧论坛. 此处 [ ^ ] If your intention is to demonstrate some useful functionality, this is the wrong forum. Please delete it from here and post it in the Tips & Tricks forum. Here[^]

更多推荐

微调器应用

本文发布于:2023-10-09 06:27:45,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1474958.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!