首页 > iScroll横向移动宽度不能定要如何才能解决啊?

iScroll横向移动宽度不能定要如何才能解决啊?

1.有一个手机端导航菜单.
ul>li
每一个li里面的内容宽度不一定,也不能确定会有多少个li.

这样的话使用iScroll.js第三方库时实现横向滑动就不能实现了. 因为无法确定有多少宽还有多少可以滑动的距离..

2.通栏的幻灯片滑动也碰到上述1.描述的问题. img{max-width:100%;height:auto}

3.使用filter:blur();滤镜时子元素也都模糊了. 有没有办法让子元素不模糊啊.类似background:rgba()解决opacity的属性啊.


解决容器必须定宽的问题:

scroller li {

display: inline-block;/* changed */
/*float:left; */   /* deleted */
padding: 0 10px;
width: 120px;
height: 100%;
border-left: 1px solid #CCC;
border-right: 1px solid white;
background-color: #FAFAFA;
font-size: 14px;

}

scroller ul {

list-style: none;
display: block;
float: left;
width: 100%;
height: 100%;
padding: 0;
margin: 0;
text-align: left;
white-space:nowrap; /* added */

}

scroller {

/* width: 8520px; */ 
height: 100%;
float: left;
padding: 0;

}
float: left;很重要。

【热门文章】
【热门文章】