作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个页脚图片,点击后返回主页。但是,图像应始终可见。因此,当移动键盘出现时,图像应跳到键盘上方。
知道怎么做吗?
编辑:
这是我厌倦的指令,但是当移动键盘出现时图像不会向上移动。小键盘隐藏图像:
(function () {
'use strict';
angular
.module('TestApp')
.directive('stickyText', ['$mdSticky', stickyText]);
function stickyText($mdSticky) {
return {
restrict: 'E',
template: '<span style="position: absolute; right: 0; bottom: 0;"> <img src="assets/img/icons/home.png" style="width:40px;height:40px;"> </span>',
link: function (scope, element) {
$mdSticky(scope, element);
}
}
}
})();
HTML代码:
<sticky-text ui-sref="home"> </sticky-text>
最佳答案
我设法使用以下 jquery 将页脚移动到键盘上方:
$('form').on('focus', 'input, textarea', function() {
$("footer").addClass('aboveKeyboard');
});
$('form').on('blur', 'input, textarea', function() {
$("footer").removeClass('aboveKeyboard');
});
CSS:
.aboveKeyboard img{
top :30%;
}
HTML:
<footer ui-sref="homepg">
<img src="thumb_home.png" style="position: absolute; right: 0;bottom: 0;">
</footer>
关于css - 如何使页脚图像跳到移动键盘上方,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38767454/
我是一名优秀的程序员,十分优秀!