我正在编写一个Worklight Hybrid应用程序并在其中使用jQuery Mobile。
HTML:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
<link rel="shortcut icon" href="images/favicon.png">
<link rel="apple-touch-icon" href="images/apple-touch-icon.png">
<link rel="stylesheet" href="jqueryMobile/jquery/jquery.mobile-1.3.1.css">
<link rel="stylesheet" href="css/itemDetails.css">
<script>window.$ = window.jQuery = WLJQ;</script>
<script src="jqueryMobile/jquery/jquery-1.9.1.js"></script>
<script src="jqueryMobile/jquery/jquery.mobile-1.3.1.js"></script>
<script src="js/itemDetails.js"></script>
</head>
<body >
<div data-role="page" id="detailsPage">
<div data-role="header" id="itemDetailsNavBar">
<a href="#leftPanel" data-role="ui-icon-list-panel" data-corners="false" id="listButtonLeft"></a>
<h1>Item Details</h1>
<a href="index.html" data-role="ui-icon-edit" data-corners="false" id="editButtonRight"></a>
</div>
</div>
<script src="js/initOptions.js"></script>
<script src="js/messages.js"></script>
<script src="modules/core/MenuPanel.js"></script>
</body>
</html>
CSS:
@CHARSET "UTF-8";
#itemDetailsNavBar
{
background: #ffb400 !important;
height: 44px;
padding-top: 20px;
}
#listButtonLeft {
background: transparent url("images/list.png");
box-shadow: none;
data-corners :"false";
margin-top: 19px;
border: none;
}
#editButtonRight {
background: transparent url("images/edit.png");
box-shadow: none;
data-corners :"false";
margin-top: 15px;
border: none;
}
在浏览器中预览时,我看到它正确:
但是当通过Worklight Console的MBS进行预览时,这就是我所得到的:
答案 0 :(得分:1)
我从头部移除了CSS并在正文结束标记之前添加了它,并且在模拟器和MBS中一切似乎都正常。
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
</head>
<body >
<div data-role="page" id="detailsPage">
<div data-role="header" id="itemDetailsNavBar">
<a href="#leftPanel" data-role="ui-icon-list-panel" data-corners="false" id="listButtonLeft"></a>
<h1>Item Details</h1>
<a href="index.html" data-role="ui-icon-edit" data-corners="false" id="editButtonRight"></a>
</div>
</div>
<link rel="stylesheet" href="css/itemDetails.css">
<script src="js/itemDetails.js"></script>
</body>
</html>