帮助使用 SimpleModal 插件 (JQUERY)

发布于 2024-08-20 03:59:20 字数 1334 浏览 3 评论 0原文

您好,我正在尝试使用简单模态插件工作,但是当我单击链接时,对话框很快出现并消失。我只是想运行一个简单的对话框,如 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

寻找我们的幸福 2024-08-27 03:59:20

您可以下载基本演示,您将获得一个如何使用 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

八巷 2024-08-27 03:59:20

您需要停止该链接的默认功能。
因此,将您的代码更改为:

<script type="text/javascript">
    $(document).ready(function() {
        $("a").click(function(evt) {
            // Chained call with no options
            $("#sample").modal();
            evt.preventDefault();
        });
    });
</script> 

you need to stop the link's default function.
So change your code to:

<script type="text/javascript">
    $(document).ready(function() {
        $("a").click(function(evt) {
            // Chained call with no options
            $("#sample").modal();
            evt.preventDefault();
        });
    });
</script> 
世俗缘 2024-08-27 03:59:20

我将 jQuery 更新到 1.8.3 后解决了这个问题。

I resolved this issue after updating jQuery to 1.8.3.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文