帮助使用 SimpleModal 插件 (JQUERY)
您好,我正在尝试使用简单模态插件工作,但是当我单击链接时,对话框很快出现并消失。我只是想运行一个简单的对话框,如 http://www.ericmmartin 所示。 com/projects/simplemodal/#examples。
请告知如何使其运行。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js?ver=1.3.2'></script>
<script type='text/javascript' src='http://www.ericmmartin.com/wordpress/wp-content/themes/emm-v3/scripts/jquery.plugins.js?ver=1.0.2'></script>
<script type='text/javascript' src='http://www.ericmmartin.com/wordpress/wp-content/themes/emm-v3/scripts/jquery.simplemodal.js?ver=1.3.3'></script>
<script type="text/javascript">
$(document).ready(function() {
$("a").click(function() {
// Chained call with no options
$("#sample").modal();
});
});
</script>
<title>hi</title>
</head>
<body>
<a href="">Link</a>
</body>
</html>
Hi I am trying to use the Simple Modal plugin working, but when I click the link, the dialog box comes and goes away quickly. I am just trying to get a simple dialog running as shown in http://www.ericmmartin.com/projects/simplemodal/#examples.
Please advise how to make it running.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js?ver=1.3.2'></script>
<script type='text/javascript' src='http://www.ericmmartin.com/wordpress/wp-content/themes/emm-v3/scripts/jquery.plugins.js?ver=1.0.2'></script>
<script type='text/javascript' src='http://www.ericmmartin.com/wordpress/wp-content/themes/emm-v3/scripts/jquery.simplemodal.js?ver=1.3.3'></script>
<script type="text/javascript">
$(document).ready(function() {
$("a").click(function() {
// Chained call with no options
$("#sample").modal();
});
});
</script>
<title>hi</title>
</head>
<body>
<a href="">Link</a>
</body>
</html>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以下载基本演示,您将获得一个如何使用 SimpleModal 的简单示例。
http://www.ericmmartin.com/projects/simplemodal-demos/
顺便说一句,请不要热链接到我网站上的脚本。
-埃里克
You can download the basic demo and you will have a simple example of how to use SimpleModal.
http://www.ericmmartin.com/projects/simplemodal-demos/
BTW, please don't hot-link to the scripts on my site.
-Eric
您需要停止该链接的默认功能。
因此,将您的代码更改为:
you need to stop the link's default function.
So change your code to:
我将 jQuery 更新到 1.8.3 后解决了这个问题。
I resolved this issue after updating jQuery to 1.8.3.