- 从 CSS 中删除
box-shadow 和 text-shadow,这会使页面变慢。
- 您还可以将
-hover 和-down 类设置为与其派生类相同,以便在滚动时点击元素(如listview 链接)时浏览器不必重绘页面(这让我的 Android 2.3 设备上的滚动更加流畅)。
去除阴影:
.ui-shadow,
.ui-btn-up-a,
.ui-btn-hover-a,
.ui-btn-down-a,
.ui-body-b,
.ui-btn-up-b,
.ui-btn-hover-b,
.ui-btn-down-b,
.ui-bar-c,
.ui-body-c,
.ui-btn-up-c,
.ui-btn-hover-c,
.ui-btn-down-c,
.ui-bar-c,
.ui-body-d,
.ui-btn-up-d,
.ui-btn-hover-d,
.ui-btn-down-d,
.ui-bar-d,
.ui-body-e,
.ui-btn-up-e,
.ui-btn-hover-e,
.ui-btn-down-e,
.ui-bar-e,
.ui-overlay-shadow,
.ui-shadow,
.ui-btn-active,
.ui-body-a,
.ui-bar-a {
text-shadow: none;
box-shadow: none;
-webkit-box-shadow: none;
}
要使-hover 类相同,您需要像这样更改样式:
.ui-btn-hover-a {
border: 1px solid #000 ;
background: #444444 ;
font-weight: bold;
color: #fff ;
text-shadow: 0 -1px 1px #000 ;
background-image: -webkit-gradient(linear, left top, left bottom, from( #666 ), to( #444 ));
background-image: -webkit-linear-gradient( #666 , #444 );
background-image: -moz-linear-gradient( #666 , #444 );
background-image: -ms-linear-gradient( #666 , #444 );
background-image: -o-linear-gradient( #666 , #444 );
background-image: linear-gradient( #666 , #444 );
}
与它的导数相同(在本例中为.ui-btn-up-a):
.ui-btn-hover-a {
border: 1px solid #222 ;
background: #333333 ;
font-weight: bold;
color: #fff ;
text-shadow: 0 -1px 1px #000 ;
background-image: -webkit-gradient(linear, left top, left bottom, from( #555 ), to( #333 ));
background-image: -webkit-linear-gradient( #555 , #333 );
background-image: -moz-linear-gradient( #555 , #333 );
background-image: -ms-linear-gradient( #555 , #333 );
background-image: -o-linear-gradient( #555 , #333 );
background-image: linear-gradient( #555 , #333 );
}
您也可以对-down 类执行此操作,这些类在元素上发生tap 事件时触发:
.ui-btn-down-a {
border: 1px solid #222 ;
background: #333333 ;
font-weight: bold;
color: #fff ;
text-shadow: 0 -1px 1px #000 ;
background-image: -webkit-gradient(linear, left top, left bottom, from( #555 ), to( #333 ));
background-image: -webkit-linear-gradient( #555 , #333 );
background-image: -moz-linear-gradient( #555 , #333 );
background-image: -ms-linear-gradient( #555 , #333 );
background-image: -o-linear-gradient( #555 , #333 );
background-image: linear-gradient( #555 , #333 );
}
这里是非缩小版 jQuery Mobile 1.0 CSS 样式表的链接:http://code.jquery.com/mobile/latest/jquery.mobile.css