繁体   English   中英

如何将弹出窗口附加到页面

[英]How to attach pop-up window to the page

脚本

<SCRIPT TYPE="text/javascript">
  <!--
    function popup(mylink, windowname)
    {
      if (! window.focus)return true;
        var href;
        if (typeof(mylink) == 'string')
          href=mylink;
        else
         href=acc_like;
      window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
      return false;
    }
  //-->
</SCRIPT>

HTML

<BODY onLoad="popup('autopopup.html', 'ad')">

我正在获得弹出窗口,但是当用户在窗口外单击时,我不希望它最小化。

在我看来,您应该使用jquery对话框来获取所需的内容,以下示例(在jsFiddle尝试 ):

<!DOCTYPE html>

<html>
<head>
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.2/themes/smoothness/jquery-ui.css" />

    <script src="http://code.jquery.com/jquery-1.9.1.js"></script>  
    <script src="http://code.jquery.com/ui/1.10.2/jquery-ui.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $( "#dialog-form" ).dialog({
                modal: true <!-- is background page responsive or not --> 
            });
        });
    </script>
</head>
<body>      
    Background information
    <div id="dialog-form" title="Hello">Basic information</div> 
</body>
</html>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM