2
工作,我的iframe:jQueryUI的滑塊不IFRAME
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<link rel="stylesheet" type="text/css" href="jquery-ui-1.9.2.custom.css">
<div id="slider"></div>
</body>
</html>
,我有頁:
<!DOCTYPE html>
<html>
<head>
<script src="jquery.js"></script>
<script src="jquery-ui-1.9.2.custom.js"></script>
<title></title>
</head>
<body>
<iframe id="frame" src="iframe.html" width="800" ></iframe>
<script type="text/javascript">
$(document).ready(function() {
$('#frame').contents().find('#slider').slider({
value:2,
min: 0,
max: 6,
step: 1,
animate: true,
slide: function(event, ui) {
}
});
});
</script>
</body>
</html>
我只是想在iframe中的自定義滑塊但這不是工作,我不知道爲什麼。這項工作完美無iframe。
更新:通過調用創建IFRAME
更新。我有Uncaught ReferenceError:沒有定義jQuery jquery-ui-1.9.2.custom.js:351 (匿名函數) – Suhan
有些東西告訴我你不能從父頁面實例化一個滑塊,但你必須做在iframe中。 – adeneo
但是這是什麼原因? – Suhan