4c5c73d493e0b590bc3da0ae2d1eee9b49a390d3.svn-base 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Custom Tooltip Style - 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>Custom Tooltip Style</h2>
  14. <p>This sample shows how to change the tooltip style.</p>
  15. <div style="margin:s0px 0;"></div>
  16. <div style="padding:10px 200px">
  17. <div id="pp1" class="easyui-panel" style="width:100px;padding:5px">Hover Me</div>
  18. </div>
  19. <div style="padding:10px 200px">
  20. <div id="pp2" class="easyui-panel" style="width:100px;padding:5px">Hover Me</div>
  21. </div>
  22. <script>
  23. $(function(){
  24. $('#pp1').tooltip({
  25. position: 'right',
  26. content: '<span style="color:#fff">This is the tooltip message.</span>',
  27. onShow: function(){
  28. $(this).tooltip('tip').css({
  29. backgroundColor: '#666',
  30. borderColor: '#666'
  31. });
  32. }
  33. });
  34. $('#pp2').tooltip({
  35. position: 'bottom',
  36. content: '<div style="padding:5px;background:#eee;color:#000">This is the tooltip message.</div>',
  37. onShow: function(){
  38. $(this).tooltip('tip').css({
  39. backgroundColor: '#fff000',
  40. borderColor: '#ff0000',
  41. boxShadow: '1px 1px 3px #292929'
  42. });
  43. },
  44. onPosition: function(){
  45. $(this).tooltip('tip').css('left', $(this).offset().left);
  46. $(this).tooltip('arrow').css('left', 20);
  47. }
  48. });
  49. });
  50. </script>
  51. </body>
  52. </html>