移动电话站不支持立场:在展示有重点和虚拟键盘时确定。
为了迫使其与“机动 Chrome”一样工作,你必须使用以下职位:绝对、高:整页100%,或用于你的假装元素的集装箱,拦截雕像、插头、焦点和bl。
陷阱是把所利用的投入控制放在屏幕底线,然后才能启动重点。 在这种情况下,Siper总是可以预测地浏览量和窗户。 内部 气温正变得非常明显。
开放式 in Mobile Sato to see how it work.
请避免你有几个重点内容的形式,因为需要为固定职位提供更多trick,而只是为了示范目的而增加。
请注意,对于轮换和景观模式而言,需要增加trick。 我正在制定一个称为Tuff.js的框架,该框架将提供一个完整的集装箱,帮助移动网络开发商更快地建立网络应用。 我花了将近一年的时间进行研究。
这样,在虚拟钥匙板活跃时,防止整个窗户的滚动,你就可以使用这一简单而简单的做法。
var hack = document.getElementById( scroll-hack );
function addScrollPixel() {
if (hack.scrollTop === 0) {
// element is at the top of its scroll position, so scroll 1 pixel down
hack.scrollTop = 1;
}
if (hack.scrollHeight - hack.scrollTop === hack.clientHeight) {
// element is at the bottom of its scroll position, so scroll 1 pixel up
hack.scrollTop -= 1;
}
}
if (window.addEventListener) {
// Avoid just launching a function on every scroll event as it could affect performance.
// You should add a "debounce" to limit how many times the function is fired
hack.addEventListener( scroll , addScrollPixel, true);
} else if (window.attachEvent) {
hack.attachEvent( scroll , addScrollPixel);
}
body {
margin: 0 auto;
padding: 10px;
max-width: 800px;
}
h1>small {
font-size: 50%;
}
.container {
display: flex;
align-items: top;
justify-content: space-between;
}
.container>div {
border: #000 1px solid;
height: 200px;
overflow: auto;
width: 48%;
-webkit-overflow-scrolling: touch;
}
<h1>iOS Scroll Hack</h1>
<p>Elements with overflow:scroll have a slightly irritating behaviour on iOS, where when the contents of the element are scrolled to the top or bottom and another scroll is attempted, the browser window is scrolled instead. I hacked up a fix using minimal,
native JavaScript.</p>
<p>Both lists have standard scrolling CSS applied (<code>overflow: auto; -webkit-overflow-scrolling: touch;</code>), but the list on the right has the hack applied. You ll notice you can t trigger the browser to scroll whilst attempting to scroll the list
on the right.</p>
<p>The only very slight drawback to this is the slight "jump" that occurs when at the top or bottom of the list in the hack.</p>
<div class= container >
<div id= scroll-orig >
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li>10</li>
<li>11</li>
<li>12</li>
<li>13</li>
<li>14</li>
<li>15</li>
<li>16</li>
<li>17</li>
<li>18</li>
<li>19</li>
<li>20</li>
</ul>
</div>
<div id= scroll-hack >
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
<li>7</li>
<li>8</li>
<li>9</li>
<li>10</li>
<li>11</li>
<li>12</li>
<li>13</li>
<li>14</li>
<li>15</li>
<li>16</li>
<li>17</li>
<li>18</li>
<li>19</li>
<li>20</li>
</ul>
</div>
</div>
https://gist.github.com/avesus/957889b4941239490c6c441adbe32398“rel=“noreferer”>