0
0

content.js 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. var $parentNode = window.parent.document;
  2. function $childNode(name) {
  3. return window.frames[name]
  4. }
  5. // tooltips
  6. $('.tooltip-demo').tooltip({
  7. selector: "[data-toggle=tooltip]",
  8. container: "body"
  9. });
  10. // 使用animation.css修改Bootstrap Modal
  11. $('.modal').appendTo("body");
  12. $("[data-toggle=popover]").popover();
  13. //折叠ibox
  14. $('.collapse-link').click(function () {
  15. var ibox = $(this).closest('div.ibox');
  16. var button = $(this).find('i');
  17. var content = ibox.find('div.ibox-content');
  18. content.slideToggle(200);
  19. button.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down');
  20. ibox.toggleClass('').toggleClass('border-bottom');
  21. setTimeout(function () {
  22. ibox.resize();
  23. ibox.find('[id^=map-]').resize();
  24. }, 50);
  25. });
  26. //关闭ibox
  27. $('.close-link').click(function () {
  28. var content = $(this).closest('div.ibox');
  29. content.remove();
  30. });
  31. //判断当前页面是否在iframe中
  32. if (top == this) {
  33. var gohome = '<div class="gohome"><a class="animated bounceInUp" href="index.html?v=4.0" title="返回首页"><i class="fa fa-home"></i></a></div>';
  34. $('body').append(gohome);
  35. }
  36. //animation.css
  37. function animationHover(element, animation) {
  38. element = $(element);
  39. element.hover(
  40. function () {
  41. element.addClass('animated ' + animation);
  42. },
  43. function () {
  44. //动画完成之前移除class
  45. window.setTimeout(function () {
  46. element.removeClass('animated ' + animation);
  47. }, 2000);
  48. });
  49. }
  50. //拖动面板
  51. function WinMove() {
  52. var element = "[class*=col]";
  53. var handle = ".ibox-title";
  54. var connect = "[class*=col]";
  55. $(element).sortable({
  56. handle: handle,
  57. connectWith: connect,
  58. tolerance: 'pointer',
  59. forcePlaceholderSize: true,
  60. opacity: 0.8,
  61. })
  62. .disableSelection();
  63. };