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 に答える