【问题标题】:jQuery SimpleModal plugin - open onLoadjQuery SimpleModal 插件 - 打开 onLoad
【发布时间】:2010-12-19 23:26:47
【问题描述】:

我想使用 SimpleModal Confirm Override 功能并对其进行修改,以便在页面加载时激活它。

有人可以帮忙吗?

Link 到 SimpleModal 演示页面网站。

【问题讨论】:

    标签: jquery modal-dialog popup simplemodal


    【解决方案1】:

    这将在页面加载时显示模式对话框...

    $(document).ready(function() { 
        $('#basicModalContent').modal();
    });
    

    【讨论】:

      【解决方案2】:

      打开confirm.js并更改:

      jQuery(function ($) {
          $('#confirm-dialog input.confirm, #confirm-dialog a.confirm').click(function (e) {
              e.preventDefault();
      
              // example of calling the confirm function
              // you must use a callback function to perform the "yes" action
              confirm("Continue to the SimpleModal Project page?", function () {
                  window.location.href = 'http://www.ericmmartin.com/projects/simplemodal/';
              });
          });
      });
      

      收件人:

      jQuery(function ($) {
          // example of calling the confirm function
          // you must use a callback function to perform the "yes" action
          confirm("Continue to the SimpleModal Project page?", function () {
              window.location.href = 'http://www.ericmmartin.com/projects/simplemodal/';
          });
      });
      

      【讨论】:

        【解决方案3】:

        打开 osx.js 并删除以下行(代码从第 14 行开始)

                init: function () {
                ****$("input.osx, a.osx").click(function (e) { << delete this line
                    e.preventDefault();**** << delete this line
        
                    $("#osx-modal-content").modal({
                        overlayId: 'osx-overlay',
                        containerId: 'osx-container',
                        closeHTML: null,
                        minHeight: 80,
                        opacity: 65, 
                        position: ['0',],
                        overlayClose: true,
                        onOpen: OSX.open,
                        onClose: OSX.close
                    });
                }); <<< delete this line
            },
        

        成为

                init: function () {
        
                    $("#osx-modal-content").modal({
                        overlayId: 'osx-overlay',
                        containerId: 'osx-container',
                        closeHTML: null,
                        minHeight: 80,
                        opacity: 65, 
                        position: ['0',],
                        overlayClose: true,
                        onOpen: OSX.open,
                        onClose: OSX.close
                    });
        
            },
        

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多