var partialSlider = function () {
var pos = this.data('cust-data') || 0; if (pos == 0) {
this.animate({ 'height': '75px' }, 300);
pos = 1;
} else {
this.animate({ 'height': '95px' }, 300);
pos = 0;
} this.data('cust-data', pos);
};var pos = this.data('cust-data') || 0;这是什么意思
var pos = this.data('cust-data') || 0; if (pos == 0) {
this.animate({ 'height': '75px' }, 300);
pos = 1;
} else {
this.animate({ 'height': '95px' }, 300);
pos = 0;
} this.data('cust-data', pos);
};var pos = this.data('cust-data') || 0;这是什么意思
if(this.data('cust-data')){
pos = this.data('cust-data')
}else{
pos = 0
}
$("div").data("cust-data"); // hello
相当于关键字 KEY/VALUE键值对