0

嗨,我正在尝试使用 Simple Modal 插件工作,但是当我单击链接时,对话框来来去去很快。我只是想运行一个简单的对话框,如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>
4

3 回答 3

3

您可以下载基本演示,您将有一个简单的示例来说明如何使用 SimpleModal。

http://www.ericmmartin.com/projects/simplemodal-demos/

顺便说一句,请不要热链接到我网站上的脚本。

-埃里克

于 2010-02-13T16:18:22.893 回答
0

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

<script type="text/javascript">
    $(document).ready(function() {
        $("a").click(function(evt) {
            // Chained call with no options
            $("#sample").modal();
            evt.preventDefault();
        });
    });
</script> 
于 2012-07-28T22:24:42.313 回答
0

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

于 2014-02-18T06:56:05.690 回答