socialforge/public/javascripts/sidebar.js

64 lines
1.7 KiB
JavaScript
Raw Normal View History

2015-08-15 17:07:50 +08:00
/* =================================================
//
// jQuery Fixed Plugins 1.3.1
// author :
// Url:
// Data : 2012-03-30
//
// <20><><EFBFBD><EFBFBD> : float --> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[left or right]
// minStatue --> <20><>С״̬<D7B4><CCAC>ֻ<EFBFBD><D6BB>show_btn
// skin --> Ƥ<><C6A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// durationTime --> <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
//<2F><><EFBFBD><EFBFBD> :
$("#scrollsidebar2").fix({
float : 'right', //default.left or right
minStatue : true, //default.false or true
skin : 'green', //default.gray or yellow <20><>blue <20><>green <20><>orange <20><>white
durationTime : 1000 //
});
//
// =================================================*/
;(function($){
$.fn.fix = function(options){
var defaults = {
float : 'left',
minStatue : false,
skin : 'blue',
durationTime : 1000
}
var options = $.extend(defaults, options);
this.each(function(){
//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD>
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; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC>top
thisBox.css(options.float, 0);
if(options.minStatue){
$(".show_btn").css("float", options.float);
sideContent.css('width', 0);
show_btn.css('width', 25);
}
//close<73>¼<EFBFBD>
closeBtn.bind("click",function(){
sideContent.animate({width: '0px'},"fast");
show_btn.stop(true, true).delay(300).animate({ width: '25px'},"fast");
});
//show<6F>¼<EFBFBD>
show_btn.click(function() {
$(this).animate({width: '0px'},"fast");
sideContent.stop(true, true).delay(200).animate({ width: '154px'},"fast");
});
}); //end this.each
};
})(jQuery);