當前位置: 首頁>>代碼示例 >>用法及示例精選 >>正文


jQWidgets jqxTextArea opened屬性用法及代碼示例


jQWidgets 是一個 JavaScript 框架,用於為 PC 和移動設備製作基於 Web 的應用程序。它是一個非常強大、經過優化、與平台無關且得到廣泛支持的框架。 jqxTextArea 表示一個 jQuery Textarea 小部件,用於在文本框內插入文本內容。

opens 屬性用於獲取一個值,該值指示 auto-suggest 彈出窗口是否打開。它接受布爾類型值,其默認值為 false。

用法:

返回打開的屬性。

var opened = $('selector').jqxTextArea('opened');


鏈接文件:從給定的鏈接下載 jQWidgets。在 HTML 文件中,找到下載文件夾中的腳本文件。

<link rel=”stylesheet” href=”jqwidgets/styles/jqx.base.css” type=”text/css” />
<script type=”text/javascript” src=”scripts/jquery-1.11.1.min.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqx-all.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxcore.js”></script>
<script type=”text/javascript” src=”.jqwidgets/jqxbuttons.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxscrollbar.js”></script>
<script type=”text/javascript” src=”jqwidgets/jqxtextarea.js”></script>

例:下麵的示例說明了 jQWidgets jqxTextArea 的打開屬性。

HTML


<!DOCTYPE html>
<html lang="en">
  
<head>
    <link rel="stylesheet" href=
"jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" 
            src="scripts/jquery-1.11.1.min.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqx-all.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxcore.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxcolorpicker.js">
    </script>
    <script type="text/javascript" 
            src=".jqwidgets/jqxbuttons.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxscrollbar.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxlistbox.js">
    </script>
    <script type="text/javascript" 
            src="jqwidgets/jqxcombobox.js">
    </script>
</head>
  
<body>
    <center>
        <h1 style="color:green;">
            GeeksforGeeks
        </h1>
  
        <h3>
            jQWidgets jqxTextArea opened Property
        </h3>
  
        <textarea id='jqxTA'></textarea>
        <br>
        <input type="button" id='jqxBtn' 
            style="padding:5px 20px; margin-top:160px;" 
            value="Check popup opened or not" />
    </center>
  
    <script type="text/javascript">
        $(document).ready(function() {
            var data = [
                "Computer Science",
                "C Programming",
                "C++ Programming",
                "Java Programming",
                "Python Programming",
                "HTML",
                "CSS",
                "JavaScript",
                "jQuery",
                "PHP",
                "Bootstrap"
            ];
  
            $('#jqxTA').jqxTextArea({
                source:data,
                width:250,
                height:100,
                placeHolder:'Enter Subjects...'
            })
  
            $('#jqxBtn').on('click', function () {
                var opened = $('#jqxTA').jqxTextArea('opened');
      
                if (opened) {
                    alert('Popup opened');
                } else {
                    alert('Popup not opened');
                }
            });
        });
    </script>
</body>
  
</html>

輸出:

參考: https://www.jqwidgets.com/jquery-widgets-documentation/documentation/jqxtextarea/jquery-textarea-api.htm




相關用法


注:本文由純淨天空篩選整理自AshokJaiswal大神的英文原創作品 jQWidgets jqxTextArea opened Property。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。