Extjs Tooltip并未隐藏在Mouseout上



我能够在鼠标上创建一个工具提示,但是在鼠标上,我的工具提示不会破坏或隐藏。

我正在使用以下代码。请建议更正。

<!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',
               html : 'This is a basic toolTip'
            });
            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>

预先感谢您。

这对我有用。

<!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() {

            new Ext.button.Button({
    renderTo: Ext.getBody(),
    text: 'Click',
    tooltip: 'Tooltip',
    tooltipType: 'title'
});
         });
      </script>
   </head>
   <body>
      <div id = "buttonId"></div>
   </body>
</html>

最新更新