var _width = 600, _height = 600,
_top = (screen.height-_height)/2,
_left = (screen.width-_width)/2;
/****
* qq空间分享
*/
function shareToQzone(obj){
var title=$("#"+obj.id).attr("data_title");
var desc =$("#"+obj.id).attr("data_desc");
var summary=$("#"+obj.id).attr("data_summary");
var pic=$("#"+obj.id).attr("data_pic");
var url=$("#"+obj.id).attr("data_url");
$(".bd_weixin_popup").css('display','none');
var _shareUrl = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?';
_shareUrl += 'url=' + encodeURIComponent(url||document.location); //参数url设置分享的内容链接|默认当前页location
_shareUrl += '&showcount=0'; //参数showcount是否显示分享总数,显示:'1',不显示:'0',默认不显示
_shareUrl += '&desc=' + encodeURIComponent(desc||''); //参数desc设置分享的描述,可选参数
_shareUrl += '&summary=' + encodeURIComponent(summary||''); //参数summary设置分享摘要,可选参数
_shareUrl += '&title=' + encodeURIComponent(title||''); //参数title设置分享标题,可选参数
_shareUrl += '&site=' + encodeURIComponent(basePath); //参数site设置分享来源,可选参数
_shareUrl += '&pics=' + encodeURIComponent(pic||''); //参数pics设置分享图片的路径,多张图片以"|"隔开,可选参数
window.open(_shareUrl,'_blank','width='+_width+',height='+_height+',top='+_top+',left='+_left+',toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=0');
}
/***
* 新浪微博分享
* @returns
*/
function shareToSinaWB(obj){
var title=$("#"+obj.id).attr("data_title");
var pic=$("#"+obj.id).attr("data_pic");
var url=$("#"+obj.id).attr("data_url");
$(".bd_weixin_popup").css('display','none');
var _shareUrl = 'http://v.t.sina.com.cn/share/share.php?&appkey=895033136'; //真实的appkey,必选参数
_shareUrl += '&url='+ encodeURIComponent(url||document.location); //参数url设置分享的内容链接|默认当前页location,可选参数
_shareUrl += '&title=' + encodeURIComponent(title); //参数title设置分享的标题|默认当前页标题,可选参数
_shareUrl += '&source=' + encodeURIComponent(title);
_shareUrl += '&sourceUrl=' + encodeURIComponent(basePath);
_shareUrl += '&content=' + 'utf-8'; //参数content设置页面编码gb2312|utf-8,可选参数
_shareUrl += '&pic=' + encodeURIComponent(pic||''); //参数pic设置图片链接|默认为空,可选参数
window.open(_shareUrl,'_blank','width='+_width+',height='+_height+',top='+_top+',left='+_left+',toolbar=no,menubar=no,scrollbars=no, resizable=1,location=no,status=0');
}
/****
* 生成二维码
*/
function shareToSinaWX(){
$(".bd_weixin_popup").css('display','block');
var userAgent = window.navigator.userAgent; //取得浏览器的userAgent字符串
if (userAgent.indexOf("rv:11.0") >= 0 || userAgent.indexOf("MSIE") >= 0) {
$('#bdshare_weixin_qrcode_dialog_qr').html("").qrcode({render:"images",width:220,height:220,correctLevel:0,text:location.href});
}else{
$('#bdshare_weixin_qrcode_dialog_qr').html("").qrcode({render:"canvas",width:220,height:220,correctLevel:0,text:location.href});
}
}
/****
* 生成二维码
*/
function shareToSinaWX(url){
url = url||location.href;
$("#weixin_tc").css("top",200);
$(".bd_weixin_popup").css('display','block');
var userAgent = window.navigator.userAgent; //取得浏览器的userAgent字符串
if (userAgent.indexOf("rv:11.0") >= 0 || userAgent.indexOf("MSIE") >= 0) {
$('#bdshare_weixin_qrcode_dialog_qr').html("").qrcode({render:"images",width:220,height:220,correctLevel:0,text:url});
}else{
$('#bdshare_weixin_qrcode_dialog_qr').html("").qrcode({render:"canvas",width:220,height:220,correctLevel:0,text:url});
}
}
/***
* 关闭二维码
*/
function weixinColse(){
$(".bd_weixin_popup").css('display','none');
_top = (screen.height-_height)/2,
_left = (screen.width-_width)/2;
/****
* qq空间分享
*/
function shareToQzone(obj){
var title=$("#"+obj.id).attr("data_title");
var desc =$("#"+obj.id).attr("data_desc");
var summary=$("#"+obj.id).attr("data_summary");
var pic=$("#"+obj.id).attr("data_pic");
var url=$("#"+obj.id).attr("data_url");
$(".bd_weixin_popup").css('display','none');
var _shareUrl = 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?';
_shareUrl += 'url=' + encodeURIComponent(url||document.location); //参数url设置分享的内容链接|默认当前页location
_shareUrl += '&showcount=0'; //参数showcount是否显示分享总数,显示:'1',不显示:'0',默认不显示
_shareUrl += '&desc=' + encodeURIComponent(desc||''); //参数desc设置分享的描述,可选参数
_shareUrl += '&summary=' + encodeURIComponent(summary||''); //参数summary设置分享摘要,可选参数
_shareUrl += '&title=' + encodeURIComponent(title||''); //参数title设置分享标题,可选参数
_shareUrl += '&site=' + encodeURIComponent(basePath); //参数site设置分享来源,可选参数
_shareUrl += '&pics=' + encodeURIComponent(pic||''); //参数pics设置分享图片的路径,多张图片以"|"隔开,可选参数
window.open(_shareUrl,'_blank','width='+_width+',height='+_height+',top='+_top+',left='+_left+',toolbar=no,menubar=no,scrollbars=no,resizable=1,location=no,status=0');
}
/***
* 新浪微博分享
* @returns
*/
function shareToSinaWB(obj){
var title=$("#"+obj.id).attr("data_title");
var pic=$("#"+obj.id).attr("data_pic");
var url=$("#"+obj.id).attr("data_url");
$(".bd_weixin_popup").css('display','none');
var _shareUrl = 'http://v.t.sina.com.cn/share/share.php?&appkey=895033136'; //真实的appkey,必选参数
_shareUrl += '&url='+ encodeURIComponent(url||document.location); //参数url设置分享的内容链接|默认当前页location,可选参数
_shareUrl += '&title=' + encodeURIComponent(title); //参数title设置分享的标题|默认当前页标题,可选参数
_shareUrl += '&source=' + encodeURIComponent(title);
_shareUrl += '&sourceUrl=' + encodeURIComponent(basePath);
_shareUrl += '&content=' + 'utf-8'; //参数content设置页面编码gb2312|utf-8,可选参数
_shareUrl += '&pic=' + encodeURIComponent(pic||''); //参数pic设置图片链接|默认为空,可选参数
window.open(_shareUrl,'_blank','width='+_width+',height='+_height+',top='+_top+',left='+_left+',toolbar=no,menubar=no,scrollbars=no, resizable=1,location=no,status=0');
}
/****
* 生成二维码
*/
function shareToSinaWX(){
$(".bd_weixin_popup").css('display','block');
var userAgent = window.navigator.userAgent; //取得浏览器的userAgent字符串
if (userAgent.indexOf("rv:11.0") >= 0 || userAgent.indexOf("MSIE") >= 0) {
$('#bdshare_weixin_qrcode_dialog_qr').html("").qrcode({render:"images",width:220,height:220,correctLevel:0,text:location.href});
}else{
$('#bdshare_weixin_qrcode_dialog_qr').html("").qrcode({render:"canvas",width:220,height:220,correctLevel:0,text:location.href});
}
}
/****
* 生成二维码
*/
function shareToSinaWX(url){
url = url||location.href;
$("#weixin_tc").css("top",200);
$(".bd_weixin_popup").css('display','block');
var userAgent = window.navigator.userAgent; //取得浏览器的userAgent字符串
if (userAgent.indexOf("rv:11.0") >= 0 || userAgent.indexOf("MSIE") >= 0) {
$('#bdshare_weixin_qrcode_dialog_qr').html("").qrcode({render:"images",width:220,height:220,correctLevel:0,text:url});
}else{
$('#bdshare_weixin_qrcode_dialog_qr').html("").qrcode({render:"canvas",width:220,height:220,correctLevel:0,text:url});
}
}
/***
* 关闭二维码
*/
function weixinColse(){
$(".bd_weixin_popup").css('display','none');
}
htm