作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Mottie 链接:https://github.com/Mottie/Keyboard
我正在使用带有“导航”和“移动”扩展名的 Mottie 键盘。除了未突出显示“当前 key ”外,它工作正常。我可以在键盘上导航并单击 enter,它会显示出来,但我无法直观地看到选择了哪个键。
根据文档和工作示例,在“样式”中添加我的代码片段应该可以解决问题,但它不会改变任何东西。
我的 HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Virtual Keyboard Mobile Demo</title>
<!-- demo -->
<link href="css/demo.css" rel="stylesheet">
<!-- jQuery & jQuery UI + theme (required) -->
<script src="http://code.jquery.com/jquery-2.1.3.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.3/jquery-ui.min.js"></script>
<link href="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css" rel="stylesheet">
<script src="http://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<!-- keyboard widget css & script (required) -->
<link href="css/keyboard.css" rel="stylesheet">
<script src="js/jquery.keyboard.js"></script>
<script src="js/jquery.keyboard.extension-navigation.js"></script>
<!-- keyboard extensions (optional) -->
<script src="js/jquery.mousewheel.js"></script>
<!--
<script src="../js/jquery.keyboard.extension-typing.js"></script>
<script src="../js/jquery.keyboard.extension-autocomplete.js"></script>
-->
<script src="js/jquery.keyboard.extension-mobile.js"></script>
<style>
html head + body .ui-btn.ui-btn-c:hover,
html head + body .ui-btn.ui-btn-c.ui-btn-hover,
html head + body .ui-btn.ui-btn-c:active,
html head + body .ui-btn.ui-btn-c.ui-btn-active {
background-color: #f7931e;
border-color: #a37a00;
color: #fff;
text-shadow: 0 1px 0 #ffcc33;
}
.ui-keyboard-button.ui-state-active.ui-state-hover {
border: 1px solid #fff !important;
-moz-box-shadow: 1px 1em 1px #ffba2b inset !important;
-webkit-box-shadow: 1px 1em 1px #ffba2b inset !important;
box-shadow: 1px 1em 1px #ffba2b inset !important;
}
/* Class added to indicate the virtual keyboard has navigation focus */
.hasFocus {
border-color: #59b4d4 !important;
}
</style>
<!-- initialize keyboard (required) -->
</head>
<body id="mobile">
<div id="wrap"> <!-- wrapper only needed to center the input -->
<!-- keyboard input -->
<label for="keyboard"></label>
<input id="keyboard" name="keyboard" type="text">
</div> <!-- End wrapper -->
<script>
$(function() {
$('#keyboard')
.keyboard({
})
/* initial setup for mobile extension */
.addMobile({
// keyboard wrapper theme
container : { theme:'b' },
// theme added to all regular buttons
buttonMarkup : { theme:'b', shadow:'true', corners:'true' },
// theme added to all buttons when they are being hovered
buttonHover : { theme:'a' },
// theme added to action buttons (e.g. tab, shift, accept, cancel);
// parameters here will override the settings in the buttonMarkup
buttonAction : { theme:'c' },
// theme added to button when it is active (e.g. shift is down)
// All extra parameters will be ignored
buttonActive : { theme:'c' }
});
$('#keyboard')
.keyboard({
})
.addNavigation({
position : [0,0], // set start position [row-number, key-index]
toggleMode : true, // true = navigate the virtual keyboard, false = navigate in input/textarea
focusClass : 'hasFocus' // css class added to the keyboard when toggle mode is on
});
});
</script>
</body>
</html>
有使用经验的人能看出问题所在吗?谢谢!
最佳答案
设法修复它!将其放入样式中:
<style>
html head + body .ui-navbutton.ui-navbutton-c:hover,
html head + body .ui-navbutton.ui-navbutton-c.ui-navbutton-hover,
html head + body .ui-navbutton.ui-navbutton-c:active,
html head + body .ui-navbutton.ui-navbutton-c.ui-navbutton-active {
border-color: #a37a00;
color: #fff !important;
}
html head+body button.ui-keyboard-button.ui-state-hover {
border: 1px solid #830000 !important;
background-color: #999999 !important;
}
/* Class added to indicate the virtual keyboard has navigation focus */
.hasFocus {
border-color: #59b4d4 !important;
}
.navbutton {
line-height: 30px;
margin: 2px;
padding: 5px;
border: #333 1px solid;
}
</style>
关于javascript - 无法让 mottie jQuery 键盘突出显示所选键,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31277670/
我正在尝试用 Swift 编写这段 JavaScript 代码:k_combinations 到目前为止,我在 Swift 中有这个: import Foundation import Cocoa e
我是一名优秀的程序员,十分优秀!