custom_service.js
1.6 KB
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
;(function($){
$.fn.fix = function(options){
var defaults = {
float : 'left',
minStatue : false,
skin : 'blue',
durationTime : 1000
}
var options = $.extend(defaults, options);
this.each(function(){
var thisBox = $(this),
closeBtn = thisBox.find('.close_btn' ),
show_btn = thisBox.find('.show_btn' ),
sideContent = thisBox.find('.side_content'),
sideList = thisBox.find('.side_list')
;
var defaultTop = thisBox.offset().top; //Ĭtop
thisBox.css(options.float, 0);
if(options.minStatue){
$(".show_btn").css("float", options.float);
sideContent.css({'width':0,'display':'none'});
show_btn.css('width', 37);
}
$(window).bind("scroll",function(){
var offsetTop = defaultTop + $(window).scrollTop() + "px";
thisBox.animate({
top: offsetTop
},
{
duration: options.durationTime,
queue: false
});
});
closeBtn.bind("click",function(){
sideContent.animate({width: '0px'},"fast");
show_btn.stop(true, true).delay(300).animate({ width: '37px'},"fast");
});
show_btn.click(function() {
$(this).animate({width: '0px','display':'none'},"fast");
sideContent.stop(true, true).delay(200).animate({ width: '166px'},"fast");
});
});
};
})(jQuery);
function showMsgPop(){
$('.inquiry-pop-bd').fadeIn('fast')
}
function hideMsgPop(){
$('.inquiry-pop-bd').fadeOut('fast')
}