iphone 微信瀏覽器上拽拽異常、失效問題(直接貼代碼)

来源:http://www.cnblogs.com/wangquansheng/archive/2017/12/07/7999170.html
-Advertisement-
Play Games

<!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8"> <title>fixed解決方案</title> <script src="../jsDemo/jquery-1.8.2.min.js?3393"></script> <styl ...


<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>fixed解決方案</title>
<script src="../jsDemo/jquery-1.8.2.min.js?3393"></script>
<style>
* {
margin: 0;
padding: 0;
}

html {
width: 100%;
background-color: plum;
}

body {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
}

.other {
position: fixed;
width: 100%;
height: 5rem;
line-height: 5rem;
text-align: center;
background-color: orangered;
z-index: 10000;
}

.container2 {
width: 100%;
height: 100%;
margin-top: 5rem;
margin-bottom: 3rem;
box-sizing: border-box;
background-color: greenyellow;
}

.container2 .item {
height: 4rem;
line-height: 4rem;
text-align: center;
border-bottom: solid 2px gray;
}

.button {
position: fixed;
bottom: 0;
width: 100%;
height: 3rem;
line-height: 3rem;
text-align: center;
background-color: #00b3ee;
}
</style>

</head>
<body>
<div class="other">其 他</div>
<div class="container2" id="container2">
<div>
<div class="item">項目0</div>
<div class="item">項目1</div>
<div class="item">項目2</div>
<div class="item">項目3</div>
<div class="item">項目4</div>
<div class="item">項目5</div>
<div class="item">項目6</div>
<div class="item">項目7</div>
<div class="item">項目8</div>
<div class="item">項目9</div>
</div>
</div>
<div class="button">按 鈕</div>
<script src="http://momo-project.b0.upaiyun.com/Assets/IOS_FIXED/iscroll-infinite.js"></script>
</body>
</html>
<script type="text/javascript">
function resetFontSize() {
if (navigator.userAgent.indexOf('Mobile') !== -1) {
document.documentElement.style.fontSize = document.documentElement.clientWidth / 1440 * 100 + 'px';
} else {
document.documentElement.style.fontSize = document.documentElement.clientHeight / 1440 * 50 + 'px';
}
}

window.addEventListener('resize', resetFontSize, false);
resetFontSize();

var $container2 = document.querySelector('.container2');
var $other = document.querySelector('.other');
var $button = document.querySelector('.button');
$container2.style.height = (document.documentElement.clientHeight - $other.clientHeight - $button.clientHeight) + 'px';
var myScroll = new IScroll('#container2', {
mouseWheel: true,
scrollbars: true
});
</script>


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 背景 目前AI 處於風口浪尖,作為 公司的CTO,也作為自己的技術專研,開始了AI之旅,在朋友圈中也咨詢 一些大牛對於AI 機器學習框架的看法,目前自己的研究方向主要開源的 AI 庫,如:Emgu CV、TensorFlow、CNTK 等等,針對 四大平臺 百度AI、阿裡ET、騰訊AI、科大訊飛AI ...
  • 一,效果圖。 二,代碼。 ...
  • 本章目標 一、理解什麼是Intent組件 二、掌握在Intent中傳遞參數 三、掌握多個Activity組件進行交互通信 一、什麼是Intent? 1、同Activity一樣,也是Android應用組件 2、在Android中承擔著一種指令輸出的作用 Intent負責對應用中一次操作的動作及動作相關 ...
  • Android點擊事件 備註 全局實現View.OnClickListener 或許需要將 MainActivity 設置為 public 註冊事件 定義函數 代碼 ...
  • 主線程刷新UI 單例 ...
  • 這幾天又遇到要調節列表分割線位置,就想起很久以前剛做時的做法:把自帶的分割線隱藏,然後自己加一條UIView,哈哈,不過這一兩年不那麼幹了,把這個方法貼出來; 在 Tableview 的代理方法中,實現下麵的代理方法: UIEdgeInsetsMake(上,左,下,右)自己可以調節,UIEdgeIn ...
  • Xcode9之前 設置狀態欄顏色首先在info.plist文件中,加入UIViewControllerBasedStatusBarAppearance = false; 讓後在delegate didFinishLaunchingWithOptions 方法中加入下麵的代碼就可以了; Xcode9之 ...
  • 最近寫了個下拉控制項,和幾個下拉的頭部樣式,下拉控制項可以連續添加疊加幾個頭部視圖 下麵是沒有添加任何頭部尾部的視圖下拉效果 一步一步來介紹,先介紹這個下拉效果,在介紹自定義的頭部 首先在使用上,和普通的控制項沒有兩樣,拿recyclerview來做例子,因為recyclerview使用比較多,而且可以替 ...
一周排行
    -Advertisement-
    Play Games
  • 示例項目結構 在 Visual Studio 中創建一個 WinForms 應用程式後,項目結構如下所示: MyWinFormsApp/ │ ├───Properties/ │ └───Settings.settings │ ├───bin/ │ ├───Debug/ │ └───Release/ ...
  • [STAThread] 特性用於需要與 COM 組件交互的應用程式,尤其是依賴單線程模型(如 Windows Forms 應用程式)的組件。在 STA 模式下,線程擁有自己的消息迴圈,這對於處理用戶界面和某些 COM 組件是必要的。 [STAThread] static void Main(stri ...
  • 在WinForm中使用全局異常捕獲處理 在WinForm應用程式中,全局異常捕獲是確保程式穩定性的關鍵。通過在Program類的Main方法中設置全局異常處理,可以有效地捕獲並處理未預見的異常,從而避免程式崩潰。 註冊全局異常事件 [STAThread] static void Main() { / ...
  • 前言 給大家推薦一款開源的 Winform 控制項庫,可以幫助我們開發更加美觀、漂亮的 WinForm 界面。 項目介紹 SunnyUI.NET 是一個基於 .NET Framework 4.0+、.NET 6、.NET 7 和 .NET 8 的 WinForm 開源控制項庫,同時也提供了工具類庫、擴展 ...
  • 說明 該文章是屬於OverallAuth2.0系列文章,每周更新一篇該系列文章(從0到1完成系統開發)。 該系統文章,我會儘量說的非常詳細,做到不管新手、老手都能看懂。 說明:OverallAuth2.0 是一個簡單、易懂、功能強大的許可權+可視化流程管理系統。 有興趣的朋友,請關註我吧(*^▽^*) ...
  • 一、下載安裝 1.下載git 必須先下載並安裝git,再TortoiseGit下載安裝 git安裝參考教程:https://blog.csdn.net/mukes/article/details/115693833 2.TortoiseGit下載與安裝 TortoiseGit,Git客戶端,32/6 ...
  • 前言 在項目開發過程中,理解數據結構和演算法如同掌握蓋房子的秘訣。演算法不僅能幫助我們編寫高效、優質的代碼,還能解決項目中遇到的各種難題。 給大家推薦一個支持C#的開源免費、新手友好的數據結構與演算法入門教程:Hello演算法。 項目介紹 《Hello Algo》是一本開源免費、新手友好的數據結構與演算法入門 ...
  • 1.生成單個Proto.bat內容 @rem Copyright 2016, Google Inc. @rem All rights reserved. @rem @rem Redistribution and use in source and binary forms, with or with ...
  • 一:背景 1. 講故事 前段時間有位朋友找到我,說他的窗體程式在客戶這邊出現了卡死,讓我幫忙看下怎麼回事?dump也生成了,既然有dump了那就上 windbg 分析吧。 二:WinDbg 分析 1. 為什麼會卡死 窗體程式的卡死,入口門檻很低,後續往下分析就不一定了,不管怎麼說先用 !clrsta ...
  • 前言 人工智慧時代,人臉識別技術已成為安全驗證、身份識別和用戶交互的關鍵工具。 給大家推薦一款.NET 開源提供了強大的人臉識別 API,工具不僅易於集成,還具備高效處理能力。 本文將介紹一款如何利用這些API,為我們的項目添加智能識別的亮點。 項目介紹 GitHub 上擁有 1.2k 星標的 C# ...