customcontent.html 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Custom Tooltip Content - 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 Content</h2>
  14. <div class="demo-info">
  15. <div class="demo-tip icon-tip"></div>
  16. <div>Access to each elements attribute to get the tooltip content.</div>
  17. </div>
  18. <div style="margin:10px 0;"></div>
  19. <div id="pg" data-options="total:114" style="border:1px solid #ddd;"></div>
  20. <script>
  21. $(function(){
  22. $('#pg').pagination().find('a.l-btn').tooltip({
  23. content: function(){
  24. var cc = $(this).find('span.l-btn-empty').attr('class').split(' ');
  25. var icon = cc[1].split('-')[1];
  26. return icon + ' page';
  27. }
  28. });
  29. });
  30. </script>
  31. </body>
  32. </html>