Jquery 绑定密钥事件以运行元素的a href
我有这个密码Jquery 绑定密钥事件以运行元素的a href,jquery,Jquery,我有这个密码 <script type="text/javascript"> function liveeditor() { mywindow = window.open("/h8-html-editor", "LiveEditor", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=900px,height=900px"
<script type="text/javascript">
function liveeditor()
{ mywindow = window.open("/h8-html-editor", "LiveEditor", "toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=900px,height=900px");
mywindow.moveTo(15, 15);
}
</script>
我将如何实现上面的代码?我是否会使用.keydown函数创建另一个代码,其中mywindow=window.open代码位于警报所在的位置
我尝试的代码只是没有从我上面发布的函数liveeditor的代码中获取事件
不知道你在问什么。也许答案是这样的
$('#target').click(function() {
liveeditor();
});
犯错误您希望哪个键使该函数运行?你确定你不是指点击吗?你想让liveeditor功能在每次按键时都运行吗?我有两个。我希望按下E时按下liveeditor,按下E时打开colorpick我希望运行click func和keypress func。有人支持吗?我已经用我试图编写的另一个代码更新了第一篇文章;
$(function(){
$(window).keydown(function(event){
if (event.which == 67) {
event.liveeditor();
}
if (event.which == 69) {
event.colorpick();
}
});
});
$('#target').click(function() {
liveeditor();
});