tooltipdialog.html 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Tooltip Dialog - jQuery EasyUI Demo</title>
  6. <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
  7. <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
  8. <link rel="stylesheet" type="text/css" href="../demo.css">
  9. <script type="text/javascript" src="../../jquery.min.js"></script>
  10. <script type="text/javascript" src="../../jquery.easyui.min.js"></script>
  11. </head>
  12. <body>
  13. <h2>Tooltip Dialog</h2>
  14. <p>This sample shows how to create a tooltip dialog.</p>
  15. <div style="margin:20px 0;"></div>
  16. <div style="padding:10px 200px">
  17. <p><a id="dd" href="javascript:void(0)">Click here</a> to see the tooltip dialog.
  18. </div>
  19. <script>
  20. $(function(){
  21. $('#dd').tooltip({
  22. content: $('<div></div>'),
  23. showEvent: 'click',
  24. onUpdate: function(content){
  25. content.panel({
  26. width: 200,
  27. border: false,
  28. title: 'Login',
  29. href: '_dialog.html'
  30. });
  31. },
  32. onShow: function(){
  33. var t = $(this);
  34. t.tooltip('tip').unbind().bind('mouseenter', function(){
  35. t.tooltip('show');
  36. }).bind('mouseleave', function(){
  37. t.tooltip('hide');
  38. });
  39. }
  40. });
  41. });
  42. </script>
  43. </body>
  44. </html>