我正在尝试实现一个 JS 模态窗口,并且几乎已经逐字复制了插件的代码,但它仍然无法工作;以下是我的代码...
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="avgrund.css">
</head>
<body>
<div class="buttons">
<a href="#" id="show" class="button left">Show it</a>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery
/1.7.2/jquery.min.js"></script>
<script src="jquery.avgrund.js"></script>
<script>
$(function() {
$('#show').avgrund({
height: 200,
holderClass: 'custom',
showClose: true,
showCloseText: 'Close',
enableStackAnimation: true,
onBlurContainer: '.container',
template: '<p>So implement your design ' +
'and place content here! If you want to ' +
'close modal, please hit "Esc", click ' +
'somewhere on the screen or use special ' +
'button.</p>'
});
});
</script>
</body>
</html>
包含此代码的 html 文件与所有必需的 JS 和 CSS 文件位于同一目录中。我相信我已经把一切都带到了最基本的基础上,但不明白为什么这不起作用;我缺少什么?模态检索自 http://labs.voronianski.com/jquery.avgrund.js/
最佳答案
尝试将 avgrund 脚本替换到此位置,如果有效,请保存它。
我已经测试过这个并且它对我有用
<script src="https://rawgithub.com/voronianski/jquery.avgrund.js/master/jquery.avgrund.min.js"></script>
关于javascript - 无法弄清楚为什么 JS 插件不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22395914/