簡體   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