
Security News
GitHub Actions Checkout Now Blocks Risky pull_request_target Checkouts
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.
jroll-fixedinput
Advanced tools
从JRoll v2.2.0版本开始,JRoll删除了adjustTop选项,自动调整安卓机输入框位置的功能抽离到jroll-fixedinput.js里。fixedinput.js可使wrapper里被遮挡的input/textarea在focus时能自动上移到可见位置(屏幕上半部分)。
普通方式引入
<script src="jroll.js"></script>
<script src="jroll-fixedinput.js"></script>
CommonJS规范引入
var JRoll = require('jroll.js');
require('jroll-fixedinput.js'); //不需要赋给变量,运行就好了
var jroll = new JRoll("#wrapper");
jroll.fixedinput(); //使该JRoll对象里的input/textarea在focus时能自动上移到可见位置
AMD规范引入(requireJS)
//配置jroll-fixedinput依赖jroll
require.config({
baseUrl: './',
paths: {
'jroll-fixedinput': 'js/jroll-fixedinput'
}
shim: {
'jroll-fixedinput': {
deps: ['jroll'] //jroll.js的路径
}
}
});
define(['jroll-fixedinput'], function(JRoll) {
//jroll-fixedinput将会返回JRoll,因此不需要单独引入jroll.js
var jroll = new JRoll("#wrapper");
jroll.fixedinput(120); //上移到离wrapper底部120px处
});
如果遇到输入框聚焦时滑动页面,软键盘收起后页面向上缩减了一截滑不下来的情况,可以尝试将wrapper设为position:fixed来解决
v1.2.3 (2017-04-06)
v1.2.2 (2017-03-31)
v1.2.1 (2017-03-30)
v1.2.0 (2017-03-29)
v1.1.0 (2017-03-15)
jroll.fixedinput(100)所带的参数由原来是距离顶部位置改为距离底部的位置v1.0.3 (2017-02-16)
v1.0.2 (2016-11-08)
v1.0.1 (2016-07-29)
v1.0.0 (2016-07-24)
FAQs
The npm package jroll-fixedinput receives a total of 3 weekly downloads. As such, jroll-fixedinput popularity was classified as not popular.
We found that jroll-fixedinput demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
GitHub Actions checkout now blocks risky pull_request_target checkouts by default to help prevent pwn request supply chain attacks.

Product
Socket now supports Custom Roles and Repository Access Permissions so organizations can control who can access specific repositories and actions.

Product
Socket MCP now lets AI assistants review org alerts, investigate threats using the Socket threat feed, and inspect package files in addition to dependency scoring.