Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>title here</title>
- <!--[if lt IE 9]> <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]-->
- <link rel="stylesheet" type="text/css" href="includes\jqueryui\jquery-ui-1.12.1\jquery-ui.min.css" media="screen" />
- </head>
- <body>
- <a id="tooltiptest" href="#" title="tooltip">Test tooltip behavour</a>
- <div id="anelementwitouttitleattribute"></div>
- </body>
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
- <script src="includes\jqueryui\jquery-ui-1.12.1\jquery-ui.min.js"></script>
- <script type="text/javascript">
- $(function(){
- $( document ).tooltip({items: '*:not(.ui-dialog-titlebar-close)'});
- $("#tooltiptest").click(function(e){
- e.preventDefault();
- //$('.ui-tooltip').hide(); // doesn't work. dialog sets the anchor element as the focus, which recreates the tooltip
- $("<div>Hello World</div>").dialog({close:function(){
- // $("body").focus(); // doesn't work.
- // $("#anelementwitouttitleattribute").focus(); //doesn't work
- // $(document).tooltip().hide(); // doesn't work
- $(document).tooltip('disable'); // works, but now my tooltips are disabled unless I programmatically re-enable them.
- $(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
- }});
- });
- });
- </script>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement