Javascript IScroll包装不';我长不高
我有以下代码:Javascript IScroll包装不';我长不高,javascript,android,jquery,jquery-mobile,scrollview,Javascript,Android,Jquery,Jquery Mobile,Scrollview,我有以下代码: <div data-role="content" height="100%" data-iscroll> <div class="homebutton_zeile"> <a id="picture_home" href="#pictures"> <div class="homebutton_all"> <div class="homebutton_
<div data-role="content" height="100%" data-iscroll>
<div class="homebutton_zeile">
<a id="picture_home" href="#pictures">
<div class="homebutton_all">
<div class="homebutton_name">Picture</div>
<div class="homebutton_picture">
<img src="images/picture.png" alt="image"
style="position: relative;">
</div>
</div>
</a>
</div>
</div>
</div>
我正在使用:
- iscroll.js
- jQuery 1.8.2
- jQuery mobile 1.2.0
- jquerymobileiscrollview
jstorage.js
和fastclick.js
但是上面的div在iscroll的包装处没有得到一个高度。在登录之前还有一个登录,在登录之后,$.mobile.changePage(“#home”)代码>函数
我试着在changePage功能之前把它作为第一页来做,它给了我同样的效果。例如,如果我在
&nbps代码>
包装器的高度为15px,用于
但不用于内部图像。您缺少一个结束div标记…这可能是您无法获取div高度的原因。如果这真是我的问题,我非常高兴,但这只是我的复制失败:)好的,您无法获取哪个div的高度?你说的是带有class.homebutton\u name的div吗?不,我的iscroll.js卷轴包装没有高度,所以如果我用鼠标拉它,它会弹回到开头。是的,homebutton\u name div没有iscroll.js的高度。
.homebutton_zeile{
width: 100%;
height: 30%;
}
.homebutton_all{
width: 30%;
height: 90%;
float:left;
margin-left: 2%;
margin-top:15px;
}
.homebutton_picture{
position: relative;
width: 100%;
height: 85%;
float: left;
background-color: #AAC7BD;
border: 1px solid black;
border-radius: 15px;
box-shadow:8px 8px 8px #666;
}
.homebutton_name{
text-align:center;
position: relative;
top:-10px;
width: 100%;
height: 15%;
margin-left: auto;
text-decoration:none;
color:black;
}