jquery鼠标一键复制路径功能信息分享特效代码下载


jquery鼠标一键复制路径功能信息分享特效代码下载
jquery鼠标一键复制路径功能信息分享特效代码下载以及鼠标一键复制、路径功能、信息分享等js/jquery网页特效代码下载。

1. 引入JS

<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>

2. HTML代码

<style type="text/css">
*{margin:0;padding:0;list-style-type:none;}
a,img{border:0;}
a{color:#333;text-decoration:none;}
a:hover{color:#3366cc;text-decoration:underline;}
body{font:12px/180% Arial, Helvetica, sans-serif,"宋体";}
/* share-con */
.share-con{height:38px;overflow:hidden;padding-left:10px;}
.share-con span.tit{float:left;line-height:38px;}
.share-con a,.share-con a span{height:16px;width:16px;display:block;float:left;overflow:hidden;}
.share-con a{padding:3px;border:solid 1px #fff;margin-top:7px;}
.share-con a span{background-image:url(images/share-icon.gif);background-repeat:no-repeat;cursor:pointer;}
.share-con a:hover{opacity:0.7;filter:alpha(opacity=70);border:solid 1px #ddd;}
.share-con a span.copylink{background-position:0 0;}
.share-con a span.tengxunweibo{background-position:0 -16px;}
.share-con a span.xinlang{background-position:0 -32px;}
.share-con a span.sohu{background-position:0 -48px;}
.share-con a span.wangyi{background-position:0 -64px;}
.share-con a span.qqzone{background-position:0 -80px;}
.share-con a span.qqpengyou{background-position:0 -96px;}
.share-con a span.renren{background-position:0 -112px;}
.share-con a span.kaixin{background-position:0 -128px;}
.share-con a span.taojianghu{background-position:0 -144px;}
.share-con a span.douban{background-position:0 -160px;}
.share-con a span.baidusoucang{background-position:0 -176px;margin-right:0px;}
</style>
<script type="text/javascript">
function copyLink(){
	try {
		var cText =  document.location.toString();
		if (window.clipboardData) {
			window.clipboardData.setData("Text", cText);
			alert("页面链接复制成功,你可以粘贴到飞信、QQ或MSN发送给好友");
		} else if (51qianduan.comscape) {
			try {
				netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
			} catch (e) {
				alert("您的浏览器设置为不允许复制!\n如果需要此操作,请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true',再重试复制操作!");
				return false;
			}
			var clip = Components.classes['@51qianduan.com/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
			if (!clip) 
				return;
			var trans = Components.classes['@51qianduan.com/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
			if (!trans) {
				return;
			}
			trans.addDataFlavor('text/unicode');
			var str = new Object();
			var len = new Object();
			var str = Components.classes["@51qianduan.com/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
			str.data = cText;
			trans.setTransferData("text/unicode", str, cText.length * 2);
			var clipid = Components.interfaces.nsIClipboard;
			if (!clip) 
				return false;
			clip.setData(trans, null, clipid.kGlobalClipboard);
			alert("页面链接复制成功,你可以粘贴到飞信、QQ或MSN发送给好友");
		}
	} catch (e) {
	}
};
// 分享代码
var shareid = "fenxiang";
(function() {
    var a = {
        url:function() {
            return encodeURIComponent(window.location.href)
        },title:function() {
            return encodeURIComponent(window.document.title)
        },content:function(b) {
            if (b) {
                return encodeURIComponent($("#" + b).html())
            } else {
                return""
            }
        },setid:function() {
            if (typeof(shareid) == "undefined") {
                return null
            } else {
                return shareid
            }
        },kaixin:function() {
            window.open("http://www.51qianduan.com/repaste/share.php?rtitle=" + this.title() + "&rurl=" + this.url() + "&rcontent=" + this.content(this.setid()))
        },renren:function() {
            window.open("http://share.51qianduan.com/share/buttonshare.do?link=" + this.url() + "&title=" + this.title())
        },sinaminiblog:function() {
            window.open("http://v.t.51qianduan.com.cn/share/share.php?url=" + this.url() + "&title=" + this.title() + "&content=utf-8&source=&sourceUrl=&pic=")
        },baidusoucang:function() {
            window.open("http://cang.51qianduan.com/do/add?it=" + this.title() + "&iu=" + this.url() + "&dc=" + this.content(this.setid()) + "&fr=ien#nw=1")
        },taojianghu:function() {
            window.open("http://share.jianghu.51qianduan.com/share/addShare.htm?title=" + this.title() + "&url=" + this.url() + "&content=" + this.content(this.setid()))
        },wangyi:function() {
            window.open("http://t.51qianduan.com/article/user/checkLogin.do?source=%E7%BD%91%E6%98%93%E6%96%B0%E9%97%BB%20%20%20&link=" + this.url() + "&info=" + this.content(this.setid()))
        },qqzone:function() {
            window.open('http://sns.qzone.51qianduan.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=' + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(document.title))},pengyou:function() {
            window.open('http://sns.qzone.51qianduan.com/cgi-bin/qzshare/cgi_qzshare_onekey?to=pengyou&url=' + encodeURIComponent(location.href) + '&title=' + encodeURIComponent(document.title))
        },douban:function() {
            window.open("http://www.51qianduan.com/recommend/?url=" + this.url() + "&title=" + this.title() + "&v=1")
        }};
    window.share = a
})();
$(function() {
    $(".renren").click(function() {
        share.renren();
    });
    $(".xinlang").click(function() {
        share.sinaminiblog();
    });
    $(".douban").click(function() {
        share.douban();
    });
    $(".kaixin").click(function() {
        share.kaixin();
    });
    $(".taojianghu").click(function() {
        share.taojianghu();
    });
    $(".wangyi").click(function() {
        share.wangyi();
    });
    $(".qqzone").click(function() {
        share.qqzone();
    });
    $(".baidusoucang").click(function() {
        share.baidusoucang();
    });
    $(".qqweibo").click(function() {
        share.qqweibo();
    });
	$(".qqpengyou").click(function() {
        share.pengyou();
    });
});
function postToWb() {
    var _t = encodeURI(document.title);
    var _url = encodeURI(document.location);
    var _appkey = encodeURI("appkey");
    var _u = 'http://v.t.51qianduan.com/share/share.php?title=' + _t + '&url=' + _url + '&appkey=' + _appkey;
    window.open(_u);
}
</script>
<!--百度收藏有用-->
<div id="fenxiang">jquery网页特效提供了jquery 广告 jquery图片特效 jquery文字特效 jquery菜单特效 jquery弹出层特效 jquery幻灯片特效 jquery表单验证特效、jquery 提示框特效等jquery特效。<a href="https://www.51qianduan.com/" target="_blank">51前端</a></div>  
<div class="share-con">
	<span class="tit">分享有礼:</span>
	<a title="复制链接" href="javascript:void(0)" onclick="copyLink()"><span class="copylink"></span></a>
	<a title="分享到腾讯微博" href="javascript:void(0)" onclick="postToWb();"><span class="tengxunweibo"></span></a>
	<a title="分享到新浪微博" href="javascript:void(0);"><span class="xinlang"></span></a>
	<a title="分享到搜狐微博" href="javascript:void((function(s,d,e,r,l,p,t,z,c){var f='http://t.51qianduan.com/third/post.jsp?',u=z||d.location,p=['&url=',e(u),'&title=',e(t||d.title),'&content=',c||'gb2312','&pic=',e(p||'')].join('');function%20a(){if(!window.open([f,p].join(''),'mb',['toolbar=0,status=0,resizable=1,width=660,height=470,left=',(s.width-660)/2,',top=',(s.height-470)/2].join('')))u.href=[f,p].join('');};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else%20a();})(screen,document,encodeURIComponent,'','','','','','utf-8'));"><span class="sohu"></span></a>
	<a title="分享到网易微博" href="javascript:void(0);"><span class="wangyi"></span></a>
	<a title="分享到Qzone空间" href="javascript:void(0);"><span class="qqzone"></span></a>
	<a title="分享到朋友社区" href="javascript:void(0);"><span class="qqpengyou"></span></a>
	<a title="分享到人人网" href="javascript:void(0);"><span class="renren"></span></a>
	<a title="分享到开心网" href="javascript:void(0);"><span class="kaixin"></span></a>
	<a title="分享到淘江湖" href="javascript:void(0);"><span class="taojianghu"></span></a>
	<a title="分享到豆瓣" href="javascript:void(0);"><span class="douban"></span></a>
	<a title="分享到百度收藏" href="javascript:void(0);"><span class="baidusoucang"></span></a>
</div>

相关推荐

发表评论

相关文章