【发布时间】:2014-04-20 18:06:25
【问题描述】:
简单的 jQuery 不起作用在 HighSlide iFrame 弹出窗口中......
好的...这正是我所拥有的:
<html>
<head>
<title>test</title>
<link rel="stylesheet" type="text/css" href="http://cdn.example.com/plugins/highslide/highslide.css" />
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="http://cdn.example.com/plugins/highslide/highslide-ie6.css" />
<![endif]-->
<script async src='//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'></script>
</head>
<body>
<a href='update.php' onclick="return hs.htmlExpand(this, { objectType: 'iframe', allowWidthReduction: true } )">update</a>
<script type="text/javascript" src="http://cdn.example.com/plugins/highslide/highslide-full.js"></script>
<script type="text/javascript" src="http://cdn.example.com/plugins/highslide/highslide.config.js" charset="utf-8"></script>
</body>
</html>
这里是update.php
的代码<?php
echo "<head>";
echo "<script async src='//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js'></script>";
echo "</head>";
echo "<body>";
?>
<script>
$(document).ready( function(){
$('#isMain').click( function(){
if(this.checked){
$('#subCats').hide();
}else{
$('#subCats').show();
}
});
});
</script>
<?php
echo "<form action='' method='post' role='form'>";
echo "<input type='checkbox' name='isMain' id='isMain'> Is Main Category?<br>";
echo "<select name='subCats' id='subCats'>";
echo "<option value='noway'>--SELECT--</option>";
echo "<option value='1'>Games</option>";
echo "<option value='2'>Music</option>";
echo "</select>";
echo "</form>";
echo "</body>";
?>
但是 jQuery Hide Show 有时可以正常工作,有时不能正常工作...这里到底有什么问题???
【问题讨论】:
-
您在控制台中收到任何错误吗?你有现场演示吗?
标签: javascript php jquery iframe highslide