描述
工具提示:当一些事件发生时,出现的小信息基本上是用于悬停事件。
句法
这里是创建工具提示的简单语法
- T1 = new 'Ext.ToolTip'({properties});
例
下面是一个简单的例子显示工具提示
- <!DOCTYPE html>
- <html>
- <head>
- <link href="https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/classic/theme-classic/resources/theme-classic-all.css" rel="stylesheet" />
- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/extjs/6.0.0/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>
尝试一下
转载本站内容时,请务必注明来自W3xue,违者必究。