1.cookie取值 $.cookie("key值");
2.cookie赋值 $.cookie($("#currentUserId").val(),company,{ expires: 365, path: '/' });
path为页面路径;expires为cookie有效期,如果省略,则关闭浏览器时cookie清除;
3.highcharts的一些样式
html部分
<div id="containerline" style="width: 99%;min-height: 433px;"></div>
js部分
$('#containerline').highcharts({
chart: {
type: 'areaspline'
},
title: {
text: '',
x: -20 //center
},
subtitle: {
text: '',
x: -20
},
xAxis: {
categories: r.data.mapPayInfo.xInfo,
gridLineWidth: 0 //x轴网格线宽度
},
yAxis: {
gridLineWidth: 0, //y轴网格线宽度
title: {
text: ''
},
plotLines: [{
value: 0,
width: 1,
color: '#ff7e01'
}],
lineWidth: 1 //y轴
},
tooltip: {
valueSuffix: '元',
crosshairs: [{ // 设置准星线样式
width: 2,
color: '#fec994'
}],
//气泡样式
backgroundColor: '#ff7e00', // 背景颜色
borderColor: 'none', // 边框颜色
borderRadius: 3, // 边框圆角
borderWidth: 0, // 边框宽度
shadow: false, // 是否显示阴影
animation: true, // 是否启用动画效果
style: { // 文字内容相关样式
color: "#ffffff",
fontSize: "14px",
fontFamily: "Courir new"
},
shared: true,
useHTML: true,
headerFormat: '',
pointFormat: '<tr><td style="color: {series.color}">{series.name} </td>' +
'<td style="text-align: right"><b>{point.y}</b></td></tr>',
footerFormat: ''
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'middle',
borderWidth: 0,
enabled: false
},
plotOptions: {
areaspline: {
color: '#rgb(255, 250, 244)', //区域背景色
lineColor: '#ff7e00', //折线颜色
fillOpacity: 1,
}
},
series: [{
name: ' ',
data: r.data.mapPayInfo.yInfo,
showInLegend: false,
marker: {
radius: 4, //曲线点半径,默认是4
lineWidth: 0,
lineColor: '#fd932a',
fillColor: '#fd932a',
states: {
hover: {
enabled: false
}
}
}
}],
crosshairs: true
});
4.判断是否是ie浏览器
//判断浏览器是否是ie以及版本
function BrowserType()
{
var userAgents = navigator.userAgent; //取得浏览器的userAgent字符串
var isOpera = userAgents.indexOf("Opera") > -1;
var isIE = userAgents.indexOf("compatible") > -1 && userAgents.indexOf("MSIE") > -1 && !isOpera; //判断是否IE浏览器
if (isIE)
{
var reIE = new RegExp("MSIE (\\d+\\.\\d+);");
reIE.test(userAgent);
var fIEVersion = parseFloat(RegExp["$1"]);
if(fIEVersion == 7)
{ return "IE7";}
else if(fIEVersion == 8)
{ return "IE8";}
else if(fIEVersion == 9)
{ return "IE9";}
else if(fIEVersion == 10)
{ return "IE10";}
else if(fIEVersion == 11)
{ return "IE11";}
else
{ return "0"}
}//isIE end
else{
return "no ie";
}
}