我已经在我的计算机上设置了nyroModal的DOM元素(隐藏的div)exmplae添加了js文件和样式表但是当我点击链接显示隐藏的div似乎没有任何事情发生时,任何人都可以建议我可能会去哪里错?
<!DOCTYPE html >
<link rel="stylesheet" href="styles/nyroModal.css" type="text/css" media="screen" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.nyroModal.js"></script>
<!--[if IE 6]>
<script type="text/javascript" src="js/jquery.nyroModal-ie6.min.js"></script>
<![endif]-->
<script type="text/javascript">
$(function() {
$('.nyroModal').nyroModal();
});
</script>
<a href="#test" class="nyroModal">DOM Element (hidden div)</a>
<div id="test" style="display: none; width: 600px;">
<a href="demoSent.php" class="nyroModal">Open a new modal</a><br />
Test
</div>
答案 0 :(得分:0)
链接上有class="myroModal"
,而不是div。或者您需要将$('.nyroModal').nyroModal();
更改为$('.test').nyroModal();