私はモバイルウェブサイトを構築しています。ヘッダーが必要です:固定(ただし、サポートされていないモバイル)ので、iScroll4を使用しています。これは、探していると思われるためです。何らかの理由で私はそれを実装する方法を理解することができません。ここでなぜこのhtml、css、javascriptはiScroll4で動作しないのですか?
は私のHTMLです:ここでは
<html>
<head>
<!--includes the iscroll.js file-->
</head>
<body>
<div id="header">
<!--header contents-->
</div>
<div id="wrapper">
<div id="scroller">
<!--a bunch of html that you probably don't care to see-->
</div>
</div>
は私のCSSです:
#scroller {
position: absolute;
}
#wrapper {
position: absolute;
width: 100%;
top: 0px;
left: 0;
overflow: auto;
}
#header {
background: #4B92DB;
border: none;
height: 175px;
opacity: 1;
position: absolute;
left: 0;
top: 0;
width: 100%;
}
そして、ここでは私のJavascriptです:
var myScroll;
function loaded() {
myScroll = new iScroll('wrapper');
}
document.addEventListener('touchmove', function (e) { e.preventDefault(); }, false);
あなたが任意のアイデアを持っている場合、彼らは非常になります感謝。