www.gusucode.com > 51:【198-3365】仿寻模板网页模板下载素材销售下载站平台织梦模板 > 51:【198-3365】仿寻模板网页模板下载素材销售下载站平台织梦模板/templets/js/new-share.js

    	var _listImgData = {
		author  :   '',
		url     :   'http://www.ui.cn',
		title   :   '',
		pic     :   ''
	};

	function shareSina() {
		var title= '《'+ _listImgData.title +'》 发布者:'+ _listImgData.author +' - 更多大图 猛戳: '+_listImgData.url +' (分享来自 @UI中国 - 专业界面交互设计平台)';
		var pic = _listImgData.pic;
		var weibo_url = 'http://service.weibo.com/share/share.php?title='+ encodeURIComponent( title ) +'&source=bookmark&appkey=3664928472&pic='+encodeURIComponent( pic );
		window.open( weibo_url, "_blank", "height=495, width=510, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no" );
	};
	
	
	function shareDouban() {
		var title= '《'+ _listImgData.title +'》 发布者:'+ _listImgData.author +' - 更多大图 猛戳: '+_listImgData.url +' (分享来自 @UI中国 - 专业界面交互设计平台)';
		var pic = _listImgData.pic;
		var teng_rul=  'http://www.douban.com/share/service?bm=&image='+ encodeURIComponent( pic ) +'&title='+ encodeURIComponent( title );
		window.open( teng_rul, "_blank", "height=495, width=510, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no" );
	};
	function sharehuaban() {
		var title= '《'+ _listImgData.title +'》 发布者:'+ _listImgData.author +' - 更多大图 猛戳: '+_listImgData.url +' (分享来自 @UI中国 - 专业界面交互设计平台)';
		var pic = _listImgData.pic;
		var pid = 655;
		var teng_rul=  'http://huaban.com/bookmarklet/?url=http://www.ui.cn/project.php?id='+pid+'&md=ui.cn&description=&media='+encodeURIComponent( pic )+'&via=3';
		window.open( teng_rul, "_blank", "height=495, width=510, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no" );
	};
	
	$("#share-sina").click(function() {
		_listImgData.url = location.href;
		_listImgData.author = $('#list-author').text().trim();
		_listImgData.title = $('#list-title').text().trim();
		_listImgData.pic = $('.work-content img').attr('src');
		shareSina();
	});
	
	$("#share-douban").click(function() {
		_listImgData.url = location.href;
		_listImgData.author = $('#list-author').text().trim();
		_listImgData.title = $('#list-title').text().trim();
		_listImgData.pic = $('.work-content img').attr('src');
		shareDouban();
	});
	$("#share-huaban").click(function() {
		_listImgData.url = location.href;
		_listImgData.author = $('#list-author').text().trim();
		_listImgData.title = $('#list-title').text().trim();
		_listImgData.pic = $('.work-content img').attr('src');
		sharehuaban();
	});



	// 微信二维码分享框
	$(".icon-weixin1").click(function(event){

		$(this).parent().addClass("on");
		$(".weixin-box").show();

		$(".weixin-box").click(function(event){
			event.stopPropagation();
		})
		$(".icon-close").click(function(){
			infowx();
		});
		$(document).click(function(){
			infowx();
		});
		event.stopPropagation();

		function infowx(){
			$(".weixin-box").hide();
			$(".icon-weixin1").parent().removeClass("on");
		}
	});