帮助使用SimpleModal插件(JQUERY)

问题描述 投票:0回答:3

嗨,我正试图使用简单模式插件工作,但当我点击链接,对话框来了,很快就走了。我只是想让一个简单的对话框运行,如图所示。http:/www.ericmmartin.comprojectssimplemodal#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>
jquery jquery-plugins simplemodal
3个回答
3
投票

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

http:/www.ericmmartin.comprojectssimplemodal-demos

另外,请不要在我的网站上热链接到脚本。

-埃里克


0
投票

你需要停止链接的默认功能,所以将你的代码改为。

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

0
投票

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

© www.soinside.com 2019 - 2024. All rights reserved.