Authored by 2586703@qq.com

js规范

... ... @@ -124,7 +124,7 @@ require("./login");
if(data.page){
var commentPage = data.page;
var pageWrap = $('<div style="display:none" class="pager-content comment-pager-content"></div>');
var pageIcon = $('<div class="channel-index-pager">'+commentPage+'</div>')
var pageIcon = $('<div class="channel-index-pager">'+commentPage+'</div>');
commentsList.after(pageWrap);
pageIcon.appendTo(pageWrap);
}
... ... @@ -426,10 +426,10 @@ require("./login");
if (!_this.attr('ref')) return;
window.open(_this.attr('ref'), "","width=760,height=650,top=300,left=300");
return false;
})
});
$(".feedback-login").on("click","a.yoho",function(){
$(this).login("loginBoxAnimate");
})
});
},
publishComment:function(){
... ...
... ... @@ -156,7 +156,7 @@ require('./lazyloadImage');
}
this._calculationWidth(this.len,this.width);
this.$element.css({'left': -(this.index-1)*this.width});
}
};
};
... ...
... ... @@ -24,7 +24,7 @@ var $=require("jquery");
imgSrcAttr:'data-original'
};
ImgZoom.prototype.getDefaults = function () {
return ImgZoom.DEFAULTS
return ImgZoom.DEFAULTS;
};
//初始化
ImgZoom.prototype.init = function(){
... ... @@ -118,11 +118,11 @@ var $=require("jquery");
_this.open();
}
if(!_this.$box.hasClass("complete")){
_this.$box.addClass("complete")
_this.$box.addClass("complete");
}
_this.$box.css("margin-top",-_this.$box.outerHeight()/2);
_this.$box.css("margin-left",-_this.$box.outerWidth()/2);
})
});
_this.getArrowState();
};
... ... @@ -135,7 +135,7 @@ var $=require("jquery");
callback.call(img);//将回调函数的this替换为Image对象
img = null;
}
}
};
}else{
img.onload = function () { //图片下载完毕时异步调用callback函数。
callback.call(img);//将回调函数的this替换为Image对象
... ... @@ -180,5 +180,5 @@ var $=require("jquery");
$.fn.ImgZoom.noConflict = function () {
$.fn.ImgZoom = old;
return this;
}
};
}($);
... ...
... ... @@ -215,7 +215,7 @@ exports.init=function(){
}
return row;
}
}
};
};
... ...
... ... @@ -8,9 +8,8 @@ var $=require("jquery");
require("jquery.imagesloaded");
var tmpInfo=null;
window.onresize=function(){
exports.initSlide(tmpInfo);
}
exports.initSlide(tmpInfo);
};
exports.initSlide=function(info){
tmpInfo=info;
var defaults={
... ... @@ -18,7 +17,7 @@ exports.initSlide=function(info){
mobileStartDrage:window.photoSlide_StartDrage||function(){},
mobileEndDrage:function(){},
isAndroid:false //是否为安卓客户端程序
}
};
var opts=$.extend(defaults,info);
var isMobile=opts.isMobile;
var photos=$(".photoslider_moused_over");
... ... @@ -129,7 +128,7 @@ exports.initSlide=function(info){
//var tmpHtml=$(this).parent().parent().parent().html();
}
};
}
if(isMobile===false)
... ... @@ -161,7 +160,7 @@ exports.initSlide=function(info){
});
}
}
};
function getBrowType(){
var info={};
... ...
... ... @@ -31,7 +31,7 @@ exports.init=function(info){
fbAppId:"",
fbUrl:"",
qqText:""
}
};
var options=$.extend(defaults,info);
... ... @@ -57,7 +57,7 @@ exports.init=function(info){
return options.imgFunction.apply($(".yohoo-share-button-sina"));
})();
}
window.shareUrl = options.img
window.shareUrl = options.img;
share();
});
if(options.shareUrlFunction!==null)
... ... @@ -84,9 +84,9 @@ exports.init=function(info){
u.href = [f, p].join('');
}
if (/Firefox/.test(navigator.userAgent)) {
setTimeout(a, 0)
setTimeout(a, 0);
} else {
a()
a();
}
})(screen, document, encodeURIComponent);
}
... ... @@ -185,11 +185,11 @@ $(".detail-container").on("click.closeWxDialog",function(event){
}else{
$(".wx-qrcode-dialog").hide();
}
})
});
$(".bottom-content").on("click.closeWxDialog",function(){
$(".detail-container").trigger("click.closeWxDialog");
})
});
$(".enterprise").on("click.closeWxDialog",function(){
$(".detail-container").trigger("click.closeWxDialog");
})
});
... ...