我正在使用 magnific popup 来加载一个 php 页面,但是一旦页面打开,其中的选择器就不会采用 jquerymobile 样式,而只会显示为常规输入选择器。我以这种方式加载 php 页面:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="viewport" content="width=device-width">
<link href="../../jquery.mobile-1.3.1.min.css" rel="stylesheet">
<script src="../../jquery-1.10.1.min.js"></script>
<script src="../../jquery.mobile-1.3.1.min.js"></script>
<!-- magnific popup -->
<link href="../../magnific-popup.css" rel="stylesheet" />
<script src="../../magnific_popup.js"></script>
<script>
$.mobile.loadingMessage = false;
</script>
</head>
<body>
<div data-role="page" id="home" data-theme='a'>
$.magnificPopup.open({
closeOnContentClick:false,
closeOnBgClick:false,
items: {
src: '../../test-ajax.php
},
type: 'ajax' }, 0);
}
在 test-ajax.php 页面中,我有:
<html><head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252"></head>
<body><div id="custom-content" class="mfp-bg style="max-width:100%; margin: 20px
auto;">
<style>
#custom-content img {max-width: 70%;margin-bottom: 10px;}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="viewport" content="width=device-width">
</head>
<body>
<select name="test" id="test" onChange="ReadForm (this, false);">
<option value="a">yadayada</option>
<option value="b">yadayada</option>
</select>
</body></html>
有任何想法吗 ?