liuxiaolong
2019-05-09 0d1d88cdb668e75ea8609417ac18ae19947e9525
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
var $parentNode = window.parent.document;
 
function $childNode(name) {
    return window.frames[name]
}
 
$(function () {
// tooltips
$('.tooltip-demo').tooltip({
    selector: "[data-toggle=tooltip]",
    container: "body"
});
 
// 使用animation.css修改Bootstrap Modal
$('.modal').appendTo("body");
 
$("[data-toggle=popover]").popover();
 
//折叠ibox
$('.collapse-link').click(function () {
    var ibox = $(this).closest('div.ibox');
    var button = $(this).find('i');
    var content = ibox.find('div.ibox-content');
    content.slideToggle(200);
    button.toggleClass('fa-chevron-up').toggleClass('fa-chevron-down');
    ibox.toggleClass('').toggleClass('border-bottom');
    setTimeout(function () {
        ibox.resize();
        ibox.find('[id^=map-]').resize();
    }, 50);
});
 
//左右折叠ibox
$('.collapse-left-link').click(function () {
    var ibox = $(this).closest('div.leftBox');
    var button = $(this).find('i');
    var content = ibox.find('div.leftBox-content');
    content.slideToggle(200);
    button.toggleClass('fa-chevron-left').toggleClass('fa-chevron-right');
    if(button.hasClass('fa-chevron-left')){
        setTimeout(function () {
            ibox.width("180px");
           // ibox.find('[id^=map-]').resize();
        }, 200);
    }else{
        
        setTimeout(function () {
            ibox.width("10px");
           // ibox.find('[id^=map-]').resize();
        }, 200);
        
    }
  
    
});
 
 
//关闭ibox
$('.close-link').click(function () {
    var content = $(this).closest('div.ibox');
    content.remove();
});
 
//判断当前页面是否在iframe中
if (top == this) {
    var gohome = '<div class="gohome"><a class="animated bounceInUp" href="index.html?v=3.1" title="返回首页"><i class="fa fa-home"></i></a></div>'; 
    $('body').append(gohome);
}
});
//animation.css
function animationHover(element, animation) {
    element = $(element);
    var close = $(element).find(".close-link");
    element.hover(
        function () {
            close.removeClass("hidden");
            element.addClass('animated ' + animation);
        },
        function () {
            //动画完成之前移除class
            window.setTimeout(function () {
                element.removeClass('animated ' + animation);
                close.addClass("hidden");
               
            }, 300);
        });
}
 
//拖动面板
function WinMove() {
    var element = "[class*=col]";
    var handle = ".ibox-title";
    var connect = "[class*=col]";
    $(element).sortable({
            handle: handle,
            connectWith: connect,
            tolerance: 'pointer',
            forcePlaceholderSize: true,
            opacity: 0.8,
        })
        .disableSelection();
};