在移动屏幕底部固定div

时间:2017-10-18 18:15:25

标签: css html5 twitter-bootstrap

我的html设计需要你的帮助。 所以,基本上我有这样的表格,它工作正常。

但是当我用键盘打开它时,它会向上滚动。

我想在页面末尾保持页脚。无论键盘是否启动都可见。

这是图像。

enter image description here

这是css代码。

/**
 * putJSONObject
 *
 * @param url
 * @param jsonObject
 * @param timeoutMillis
 * @return
 */
protected static JSONObject putJSONObject (String url, JSONObject jsonObject, int timeoutMillis) throws IOException, JSONException {

    StringBuilder stringBuilder = new StringBuilder ();

    HttpURLConnection httpURLConnection;
    DataOutputStream printout;

    httpURLConnection = (HttpURLConnection) new URL (url).openConnection ();
    httpURLConnection.setRequestMethod ("POST");
    httpURLConnection.setReadTimeout (timeoutMillis);
    httpURLConnection.setConnectTimeout (timeoutMillis);
    httpURLConnection.setDoInput (true);
    httpURLConnection.setDoOutput (true);
    httpURLConnection.setUseCaches (false);
    httpURLConnection.connect ();

    // Send POST output.
    printout = new DataOutputStream (httpURLConnection.getOutputStream ());
    printout.writeBytes ("msg=" + URLEncoder.encode (jsonObject.toString (), "UTF-8"));
    printout.flush ();
    printout.close ();

    InputStreamReader inputStreamReader = new InputStreamReader (httpURLConnection.getInputStream ());

    int read;
    char[] buff = new char[4096];
    while ((read = inputStreamReader.read (buff)) != -1) {
        stringBuilder.append (buff, 0, read);
    }
    httpURLConnection.disconnect ();

    return new JSONObject (stringBuilder.toString ());

}

1 个答案:

答案 0 :(得分:0)

Yoy不能用纯CSS做到这一点。当键盘出现时,你将不得不使用JS / jQuery来隐藏页脚。不幸的是,没有办法检测键盘何时触发,所以你需要一些技巧才能这样做。

相关问题