customstyle.html 1.7 KB

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