keyup 相关问题

键盘上的键在按下后被抬起时发生的事件。

如何在 JQuery 的 Keyup 事件中保留光标位置?

我在 Keyup 事件中修改 JQuery 中日期时间输入的数据。如果日期是 10/11/2000,但它应该是 10/12/2000,突出显示 11 并输入 12(先输入 1)...

回答 0 投票 0

移动 [jQuery]Keyup 事件

我在 Android 手机上触发 keyup 事件时遇到了一些问题,这在 PC 上很好,我的代码如下: $(文档).ready(函数(){ var 负数 = {0:"</desc> <question vote="0"> <p>我在 Android 手机上触发 keyup 事件时遇到了一些问题,这在 pc 上很好,我的代码如下:</p> <pre><code>&lt;script&gt; $(document).ready(function(){ var negative = {0:&#34;Pessimistic&#34;, 1:&#34;Anarchy&#34;, 2:&#34;Agony&#34;, 3:&#34;Failure&#34;, 4:&#34;Weak&#34;, 5:&#34;Stupid&#34;, 6:&#34;Evil&#34;, 7:&#34;Jealous&#34;, 8:&#34;Enemies&#34;, 9:&#34;Suffering&#34;, 10:&#34;Misery&#34;, 11:&#34;Torture&#34;}; var positive = {12:&#34;Intellectual&#34;, 13:&#34;Laughter&#34;, 14:&#34;Approval&#34;, 15:&#34;Confidence&#34;, 16:&#34;Perfect&#34;, 17:&#34;Allowed&#34;, 18:&#34;Innocent&#34;, 19:&#34;Sensual&#34;, 20:&#34;Smiling&#34;, 21:&#34;Love&#34;, 22:&#34;Friendship&#34;, 23:&#34;Optimism&#34;}; var compsci = {24:&#34;Programming&#34;, 25:&#34;Gaming&#34;, 26:&#34;Nerd&#34;, 27:&#34;Geek&#34;, 28:&#34;Computers&#34;, 29:&#34;Binary&#34;, 30:&#34;Technology&#34;, 31:&#34;Website&#34;}; var nursing = {32:&#34;Caring&#34;, 33:&#34;Thermometer&#34;, 34:&#34;Hospital&#34;, 35:&#34;Midwife&#34;, 36:&#34;Emergency&#34;, 37:&#34;Scrubs&#34;, 38:&#34;Helpful&#34;}; //Block 1 = positive and negative words //Block 2 = computer science and nursing words //Block 3 = computer science and positive words, nursing and negative words (20 trials) //Block 4 = computer science and positive words, nursing and negative words (40 trials) //Block 5 = negative and positive words //Block 6 = negative and computer science, positive and nursing (20 trials) //Block 7 = negative and computer science, positive and nursing (40 trials) var numBlocks = 7; //The number of blocks there are var numTrials = 20; //Current/starting trials var curBlock = 1; //Current block on; always start with 1 var curTrial = 1; //Current trial on; always start with 1 var c = &#34;?&#34; var start = 0; //For timer $(document).keyup(function(e){ if(curBlock &lt;= numBlocks){ //If curBlock &lt; numBlocks $(&#34;#block&#34;).html(curBlock); if(curTrial &lt;= numTrials){ //If curTrials &lt; numTrials if(curBlock == 1){ $(&#34;#directions&#34;).html(&#34;20 Words will be shown. Press &#39;e&#39; if the word is &#34; + //Changes directions for block 2 &#34;positive, &#39;i&#39; if the word is negative. Press &#39;spacebar&#39; to begin.&#34;); $(&#34;#left&#34;).html(&#34;Positive (e)&#34;); $(&#34;#right&#34;).html(&#34;Negative (i)&#34;); if(e.which == 32 &amp;&amp; c == &#34;?&#34;){ //If spacebar pressed var date = new Date(); var seconds = date.getTime()/1000; //Timer initialization var diff = seconds - start; start = seconds var whichArray = Math.floor(Math.random() * 10); //Pick a random number between 0 and 10 c = whichArray; </code></pre> <p>这背后的想法是用户可以通过按 i 和 e 来左右分配单词。作为jQuery的新手,我对函数很陌生,尤其是在移动端。</p> </question> </body></html>

回答 0 投票 0

Jquery上有多个带keyup的函数?

我需要改变一个输入文本的ID,使用Jquery的两个函数keyup,例如,我选择了数字1的选项,在我的脚本中,我写了一个函数keyup的id 1和其他的数字2,... ...

回答 1 投票 0

特定按键的键下+键上事件

我想让背景颜色在某些键被按住时发生变化。例如,当'r'键被按住时,背景应该是红色的。当'r'键没有被按下时,背景应该是红色的。

回答 2 投票 11

如何在jquery切换搜索过滤器上显示 "无结果再试"?

我正在定制这个基本的jQuery Data Table with Search Filter教程,供我自己使用,效果很好,只是我不知道如何在过滤器返回时显示一个特定的消息... ...

回答 1 投票 0

KeyDown问题c#

我目前正在尝试做一个键降登记。基本上只是想看看我最常使用的按键。问题是,只想让它检测F1-F12按钮。另一个问题是不知道如何 ...

回答 3 投票 0

为什么我的方块(蛇)只能对角线移动?

我正在编写2个蛇车的代码,我的第一个蛇车使用WASD键盘格式,可以完美地工作。但是我的第二个蛇车,使用的是方向键,只能对角线移动。我想让两个蛇车都能 ...

回答 3 投票 -3

为什么我的正方形(蛇形)只对角移动? PYTHON

我正在编码2条蛇/汽车,而我的第一条蛇/汽车使用wasd键盘可以正常工作,而我的第二条蛇/汽车(箭头)仅沿对角线移动。我希望两条蛇/汽车都在每条路中移动...

回答 2 投票 -2

''Shift + Enter'键导航将焦点集中到Angular 9中ag-Grid的可编辑列中的两个单元格上

我正在使用带有可编辑列名为“费用”的ag-Grid。下面提到了这些要求:如果用户在此列的任何单元格中编辑一个值并按Enter键,则焦点应移动...

回答 1 投票 0

pygame键盘未正确注册

我制作了一个游戏,该游戏只能检测2个玩家的动作,但是有时候,一次按下多个键然后放开时,并不能检测到所有键都被放开了(其中一个键。 。

回答 1 投票 0


jQuery:仅在输入值更改时触发mouseup事件

当输入值发生更改时,我使用以下几行来触发事件,该值可以按预期工作。但是,当我仅单击输入字段(不进行任何更改......)

回答 1 投票 0

Pygame事件:在不释放按键的情况下触发按键事件

我正在尝试制作俄罗斯方块游戏,下面是我使方块移动的代码。我希望该块在按住箭头键时保持移动,并在释放时停止。但是当我运行代码时,...

回答 1 投票 0

pygame KEYUP仅注册KEYDOWNs

当我按下空格键时,同时打印“上”和“下”,但是当我释放时,什么也没有发生。而True:pygame.event.get(...

回答 1 投票 0

jQuery包含输入文本

我有一个简单的jQuery函数:$(document).ready(function(){$(“ #faqsearch”).keyup(function(){var xyz = $('#faqsearch').val(); $( “ .faqtitle:contains(xyz)”)。css(“ background”,...

回答 2 投票 0


Angular(9)中的测试键指令

我有一个要测试的指令。但是指令中值的长度始终是不确定的。我究竟做错了什么? @Directive({选择器:'[evAutoTab]'})导出类...

回答 1 投票 0

libgdx:为什么我的InputAdapter没有收到keyUp事件?

我正在使用libgdx重新创建口袋妖怪游戏,并且我有一个InputAdapter可以控制玩家的移动,并且效果很好。然后,我有另一个InputAdapter来控制我创建的OptionBox ...

回答 1 投票 1


Keyup事件处理程序显示性能降低

我的示例:$(document).on('keyup','[contenteditable = true]',函数(e){让_this = $(this),text = _this.text(); if(text.length === 1){让跨度= $('

回答 1 投票 2

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.