2015-03-17 15:30:15 +08:00
|
|
|
(function($){
|
|
|
|
$.fn.fix = function(options){
|
|
|
|
var defaults = {
|
|
|
|
float : 'right',
|
|
|
|
minStatue : true,
|
|
|
|
skin : 'blue',
|
|
|
|
durationTime : 1000
|
2015-09-24 11:31:07 +08:00
|
|
|
};
|
2015-03-17 15:30:15 +08:00
|
|
|
var options = $.extend(defaults, options);
|
|
|
|
|
|
|
|
this.each(function(){
|
2015-04-23 16:13:01 +08:00
|
|
|
//???????
|
2015-03-17 15:30:15 +08:00
|
|
|
var thisBox = $(this),
|
|
|
|
closeBtn = thisBox.find('.close_btn' ),
|
|
|
|
show_btn = thisBox.find('.show_btn' ),
|
2015-09-24 11:31:07 +08:00
|
|
|
sideContent = thisBox.find('.side_content');
|
2015-04-23 16:13:01 +08:00
|
|
|
var defaultTop = thisBox.offset().top; //????????top
|
2015-03-17 15:30:15 +08:00
|
|
|
thisBox.css(options.float, 0);
|
|
|
|
if(options.minStatue == "true"){
|
2015-09-24 11:31:07 +08:00
|
|
|
show_btn.css("float", options.float);
|
2015-03-17 15:30:15 +08:00
|
|
|
sideContent.css('width', 0);
|
2015-10-20 10:29:51 +08:00
|
|
|
show_btn.css('width', 28);
|
2015-03-17 15:30:15 +08:00
|
|
|
}
|
2015-04-23 16:13:01 +08:00
|
|
|
//close
|
2015-03-17 15:30:15 +08:00
|
|
|
closeBtn.bind("click",function(){
|
|
|
|
sideContent.animate({width: '0px'},"fast");
|
2015-10-20 10:29:51 +08:00
|
|
|
show_btn.stop(true, true).delay(300).animate({ width: '28px'},"fast");
|
2015-04-23 16:13:01 +08:00
|
|
|
cookiesave('minStatue','true','','','');
|
2015-03-17 15:30:15 +08:00
|
|
|
});
|
2015-04-23 16:13:01 +08:00
|
|
|
//show
|
2015-03-17 15:30:15 +08:00
|
|
|
show_btn.bind("click",function() {
|
|
|
|
$(this).animate({width: '0px'},"fast");
|
|
|
|
sideContent.stop(true, true).delay(200).animate({ width: '154px'},"fast");
|
2015-04-23 16:13:01 +08:00
|
|
|
cookiesave('minStatue','false','','','');
|
2015-03-17 15:30:15 +08:00
|
|
|
});
|
2015-04-23 16:13:01 +08:00
|
|
|
}); //end this.each
|
2015-03-17 15:30:15 +08:00
|
|
|
};
|
|
|
|
})(jQuery);
|
|
|
|
|
2015-04-23 16:13:01 +08:00
|
|
|
function f_submit()
|
|
|
|
{
|
|
|
|
$("#new_memo").submit();
|
|
|
|
}
|
|
|
|
|
2015-03-17 15:57:09 +08:00
|
|
|
function cookiesave(n, v, mins, dn, path)
|
|
|
|
{
|
|
|
|
if(n)
|
|
|
|
{
|
2015-04-23 16:13:01 +08:00
|
|
|
|
2015-03-17 15:57:09 +08:00
|
|
|
if(!mins) mins = 365 * 24 * 60;
|
|
|
|
if(!path) path = "/";
|
|
|
|
var date = new Date();
|
|
|
|
date.setTime(date.getTime() + (mins * 60 * 1000));
|
|
|
|
var expires = "; expires=" + date.toGMTString();
|
|
|
|
if(dn) dn = "domain=" + dn + "; ";
|
|
|
|
document.cookie = n + "=" + v + expires + "; " + dn + "path=" + path;
|
2015-04-23 16:13:01 +08:00
|
|
|
|
2015-03-17 15:57:09 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
function cookieget(n)
|
|
|
|
{
|
|
|
|
var name = n + "=";
|
|
|
|
var ca = document.cookie.split(';');
|
|
|
|
for(var i=0;i<ca.length;i++) {
|
|
|
|
var c = ca[i];
|
|
|
|
while (c.charAt(0)==' ') c = c.substring(1,c.length);
|
|
|
|
if (c.indexOf(name) == 0){
|
2015-09-24 11:31:07 +08:00
|
|
|
return c.substring(name.length,c.length);
|
|
|
|
}
|
2015-03-17 15:57:09 +08:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$(function(){
|
2015-09-24 11:31:07 +08:00
|
|
|
$(".closeSidebar").click(function(){
|
|
|
|
$(".show_btn").css("display","none");
|
|
|
|
$("#scrollsidebar").css("display","none");
|
|
|
|
return false;
|
2015-03-17 15:57:09 +08:00
|
|
|
});
|
|
|
|
|
2015-09-24 11:31:07 +08:00
|
|
|
$("#button1").click(function(){
|
|
|
|
myTips("反馈成功","success");
|
2015-04-23 16:13:01 +08:00
|
|
|
});
|
2015-04-24 14:47:50 +08:00
|
|
|
|
2015-09-24 11:31:07 +08:00
|
|
|
$("#scrollsidebar").fix({
|
|
|
|
float: 'right', //default.left or right
|
|
|
|
minStatue: cookieget('minStatue'),
|
|
|
|
skin: 'green', //default.gray or blue
|
|
|
|
durationTime: 600
|
|
|
|
});
|
2015-04-24 14:47:50 +08:00
|
|
|
|
|
|
|
$("#subject").keydown(function(){
|
|
|
|
var curLength=$("#subject").val().length;
|
2015-04-24 15:08:09 +08:00
|
|
|
if(curLength>50){
|
|
|
|
var num=$("#subject").val().substr(0,50);
|
2015-04-24 14:47:50 +08:00
|
|
|
$("#subject").val(num);
|
|
|
|
}
|
|
|
|
else{
|
2015-04-24 15:08:09 +08:00
|
|
|
$("#textCount").text(50-$("#subject").val().length)
|
|
|
|
}
|
2015-09-24 11:31:07 +08:00
|
|
|
}).keyup(function(){
|
2015-04-24 15:08:09 +08:00
|
|
|
var curLength=$("#subject").val().length;
|
|
|
|
if(curLength>50){
|
|
|
|
var num=$("#subject").val().substr(0,50);
|
|
|
|
$("#subject").val(num);
|
|
|
|
}
|
|
|
|
else{
|
|
|
|
$("#textCount").text(50-$("#subject").val().length)
|
2015-04-24 14:47:50 +08:00
|
|
|
}
|
2015-09-24 11:31:07 +08:00
|
|
|
});
|
|
|
|
});
|