jkey

angular 自定义 带搜索框的下拉标签

自古美人都是妖i 提交于 2020-07-24 01:40:43
/** * 带筛选功能的下拉框 * 使用方法 <select ngc-select-search name="select1" ng-options=""> * 说明[ select 一定要有name,ng-options 属性] */ app.directive('ngcSelectSearch', function ($animate, $compile, $parse) { function parseOptions(optionsExp, element, scope) { // ngOptions里的正则 var NG_OPTIONS_REGEXP = /^\s*([\s\S]+?)(?:\s+as\s+([\s\S]+?))?(?:\s+group\s+by\s+([\s\S]+?))?(?:\s+disable\s+when\s+([\s\S]+?))?\s+for\s+(?:([\$\w][\$\w]*)|(?:\(\s*([\$\w][\$\w]*)\s*,\s*([\$\w][\$\w]*)\s*\)))\s+in\s+([\s\S]+?)(?:\s+track\s+by\s+([\s\S]+?))?$/; var match = optionsExp.match(NG_OPTIONS_REGEXP); if (!(match)) { console.log(

jQuery .delegate() with a plugin?

回眸只為那壹抹淺笑 提交于 2019-12-22 00:02:38
问题 I am using a plugin named : jkey. Now i want to use the .deligate() with it. The basic syntax of this plugin is : $(document).jkey('a',function(){ jkey.log('You pressed the a key.'); }); QUESTION How do i supply the arguments like in this i want to send the key value 'a' i tried to do this $("#hmm").delegate(".mm","jkey","a",function() { $("#get").html("WOW"); }); but failed 回答1: The #hmm needs to be present at the start and .mm is what is being bound. You also need to give it an event for

jKey jQuery plugin errors in IE6/7, attempting to run whenever any un-used key is pressed. How to combat?

孤者浪人 提交于 2019-12-11 11:03:59
问题 I'm using the jKey jQuery plugin on a current project. It just allows you to easily run a function on a key press. Here's my function call: jQuery(document).jkey('left, right',function(key){ if(key == 'left'){ if (elementIndex == 0) { return; } question_nav(jQuery('.question-fieldset-active'), 'prev'); } else { if ((elementIndex + 1) == jQuery('.question-fieldset').length) { return; } question_nav(jQuery('.question-fieldset-active'), 'next'); } }); In IE6 and 7, pressing any other key on the

Doing key combos with jQuery / JavaScript

 ̄綄美尐妖づ 提交于 2019-12-09 12:14:26
问题 I'm curious how i, with the following jQuery plugin code im writing at the bottom of this question, could implement key combos. How it's working so far is it allows a user to create key commands simply by doing a normal jQuery like syntax and provide an event for the key command, like so: $(window).jkey('a',function(){ alert('you pressed the a key!'); }); or $(window).jkey('b c d',function(){ alert('you pressed either the b, c, or d key!'); }); and lastly what i want is the ability to do, but

Doing key combos with jQuery / JavaScript

我怕爱的太早我们不能终老 提交于 2019-12-03 13:33:17
I'm curious how i, with the following jQuery plugin code im writing at the bottom of this question, could implement key combos. How it's working so far is it allows a user to create key commands simply by doing a normal jQuery like syntax and provide an event for the key command, like so: $(window).jkey('a',function(){ alert('you pressed the a key!'); }); or $(window).jkey('b c d',function(){ alert('you pressed either the b, c, or d key!'); }); and lastly what i want is the ability to do, but can't figure out: $(window).jkey('alt+n',function(){ alert('you pressed alt+n!'); }); I know how to do