Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.54 KB | None | 0 0
  1. <!doctype html>
  2.  
  3. <html lang="en">
  4. <head>
  5. <meta charset="utf-8">
  6. <title>title here</title>
  7.  
  8.  
  9. <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]-->
  10.  
  11.  <link rel="stylesheet" type="text/css" href="includes\jqueryui\jquery-ui-1.12.1\jquery-ui.min.css" media="screen" />
  12.  
  13. </head>
  14.  
  15. <body>
  16.  
  17.  
  18. <a id="tooltiptest" href="#" title="tooltip">Test tooltip behavour</a>
  19. <div id="anelementwitouttitleattribute"></div>
  20. </body>
  21.  
  22.  
  23.  
  24.  
  25. <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  26. <script src="includes\jqueryui\jquery-ui-1.12.1\jquery-ui.min.js"></script>
  27.  
  28.  
  29.  
  30. <script type="text/javascript">
  31.  
  32. $(function(){
  33.    
  34.     $( document ).tooltip({items: '*:not(.ui-dialog-titlebar-close)'});
  35.      
  36.     $("#tooltiptest").click(function(e){
  37.         e.preventDefault();
  38.         //$('.ui-tooltip').hide(); // doesn't work.  dialog sets the anchor element as the focus, which recreates the tooltip
  39.        
  40.         $("<div>Hello World</div>").dialog({close:function(){
  41.            
  42.             // $("body").focus(); // doesn't work.
  43.             // $("#anelementwitouttitleattribute").focus(); //doesn't work
  44.             // $(document).tooltip().hide();  // doesn't work
  45.            
  46.             $(document).tooltip('disable');  // works, but now my tooltips are disabled unless I programmatically re-enable them.
  47.             $(document).tooltip('enable'); // ... unless I do this.   But I would like a way to do this by default for any dialog.  without having to implement it in every dialog     
  48.         }});
  49.        
  50.        
  51.     });
  52. });
  53.  
  54. </script>
  55.  
  56.  
  57. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement