Ext.js:工具提示

目录

返回到:Ext.js 教程:组件

工具提示:当一些事件发生时,出现的小信息基本上是用于悬停事件。

语法

这里是创建工具提示的简单语法:

T1 = new 'Ext.ToolTip'({properties});

下面是一个简单的例子显示工具提示

<!DOCTYPE html>
<html>
<head>
   <link href="./ext-6.0.0/build/classic/theme-classic/resources/theme-classic-all.css" rel="stylesheet">
   <script src="./ext-6.0.0/build/ext-all.js"></script>
   <script type="text/javascript">
      Ext.onReady(function() {
         toolTip = new Ext.ToolTip({       
            id : 'toolTip',
            anchor : 'bottom',
            html : 'This is a basic toolTip',
            title : 'Tool - Tip Title',
            closable : true,
            closeAction : 'hide'
         });
        Ext.create('Ext.Button', {
            renderTo: Ext.getElementById('buttonId'),
            text: 'Hover Me',
            listeners: {
               mouseover: function() {
                  toolTip.show();
               }
            }
         });
      });
   </script>
</head>
<body>
   <div id = "buttonId"></div>
</body>
</html>

运行截图如下所示:

Ext.js:工具提示

返回到:Ext.js 教程:组件

作者:terry,如若转载,请注明出处:https://www.web176.com/extjs_api/11717.html

(0)
打赏 支付宝 支付宝 微信 微信
terryterry
上一篇 2023年3月3日
下一篇 2023年3月3日

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注