Jquery實(shí)現(xiàn)彈出層分享微博插件具備動(dòng)畫效果
更新時(shí)間:2013年04月03日 16:44:47 作者:
此Jquery插件是一款非常實(shí)用的特效,不但有分享功能,還具備了動(dòng)畫效果,提高了用戶體驗(yàn),感興趣的朋友可以參考下哈
此Jquery插件是一款非常實(shí)用的特效,是很多網(wǎng)站不可缺少的推廣神兵利器,傳統(tǒng)的一般都用百度、加網(wǎng)的分享插件,但樣式外觀都不怎么好看,用戶體驗(yàn)效果差一點(diǎn),此作品不但有分享功能,還具備了動(dòng)畫效果,提高了用戶體驗(yàn)。由于用了CSS3,為了可以看到插件的最佳效果,建議大家使用谷歌、火狐等瀏覽器。。。
作品包括以下功能:
1、彈出層
2、遮罩層
3、動(dòng)畫效果
4、CSS3
效果如下:
源碼下載
代碼片段(1)
$(document).ready(function(e) {
var share_html = "";
//share_html += '<a href="javascript:void(0)" id="smohan_share" title="分享"></a>';
share_html += '<div id="Share"><ul>';
share_html += '<li title="分享到QQ空間"><a href="javascript:void(0)" class="share1"></a><span></span></li>';
share_html += '<li title="分享到新浪微博"><a href="javascript:void(0)" class="share2"></a><span></span></li>';
share_html += '<li title="分享到人人網(wǎng)"><a href="javascript:void(0)" class="share3" ></a><span></span></li>';
share_html += '<li title="分享到朋友網(wǎng)"><a href="javascript:void(0)" class="share4"></a><span></span></li>';
share_html += '<li title="分享到騰訊微博"><a href="javascript:void(0)" class="share5"></a><span></span></li>';
share_html += '<li title="分享到開心網(wǎng)"><a href="javascript:void(0)" class="share6"></a><span></span></li>';
share_html += '</ul></div>';
$('body').prepend(share_html);
$('.share').SmohanPopLayer({Shade : true,Event:'click',Content : 'Share', Title : '分享Smohan到各大社區(qū)'});
$('#Share li').each(function() {
$(this).hover(function(e) {
$(this).find('a').animate({ marginTop: 2}, 'easeInOutExpo');
$(this).find('span').animate({opacity:0.2},'easeInOutExpo');
},function(){
$(this).find('a').animate({ marginTop: 12}, 'easeInOutExpo');
$(this).find('span').animate({opacity:1},'easeInOutExpo');
});
});
var share_url = encodeURIComponent(location.href);
var share_title = encodeURIComponent(document.title);
var share_pic = "http://www.smohan.net/images/smohan.png"; //默認(rèn)的分享圖片
var share_from = encodeURIComponent("水墨寒個(gè)人官方網(wǎng)站"); //分享自(僅用于QQ空間和朋友網(wǎng),新浪的只需更改appkey 和 ralateUid就行)
//Qzone
$('#Share li a.share1').click(function(e) {
window.open("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+share_url+"&title="+share_title+"&pics="+share_pic+"&site="+share_from+"","newwindow");
});
//Sina Weibo
$('#Share li a.share2').click(function(e) {
var param = {
url:share_url ,
appkey:'678438995',
title:share_title,
pic:share_pic,
ralateUid:'3061825921',
rnd:new Date().valueOf()
}
var temp = [];
for( var p in param ){
temp.push(p + '=' + encodeURIComponent( param[p] || '' ) )
}
window.open('http://v.t.sina.com.cn/share/share.php?' + temp.join('&'));
});
//renren
$('#Share li a.share3').click(function(e) {
window.open('http://widget.renren.com/dialog/share?resourceUrl='+share_url+'&title='+share_title+'&images='+share_pic+'','newwindow');
});
//pengyou
$('#Share li a.share4').click(function(e) {
window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?to=pengyou&url='+share_url+'&pics='+share_pic+'&title='+share_title+'&site='+share_from+'','newwindow');
});
//tq
$('#Share li a.share5').click(function(e) {
window.open('http://share.v.t.qq.com/index.php?c=share&a=index&title='+share_title+'&site='+share_from+'&pic='+share_pic+'&url='+share_url+'','newwindow');
});
//kaixin
$('#Share li a.share6').click(function(e) {
window.open('http://www.kaixin001.com/repaste/bshare.php?rtitle='+share_title+'&rurl='+share_url+'&from=水墨寒個(gè)人官方網(wǎng)站','newwindow');
});
});
/*加入收藏*/
function addfavorite(){
var Url = "http://www.smohan.net";
var Title = "水墨寒個(gè)人官網(wǎng)";
if(document.all){
window.external.addFavorite(Url,Title);
}else if(window.sidebar){
window.sidebar.addPanel(Title,Url,"");
}else{
alert("請(qǐng)使用Ctrl+D鍵導(dǎo)入書簽!");
}
}
作品包括以下功能:
1、彈出層
2、遮罩層
3、動(dòng)畫效果
4、CSS3
效果如下:
源碼下載
代碼片段(1)
復(fù)制代碼 代碼如下:
$(document).ready(function(e) {
var share_html = "";
//share_html += '<a href="javascript:void(0)" id="smohan_share" title="分享"></a>';
share_html += '<div id="Share"><ul>';
share_html += '<li title="分享到QQ空間"><a href="javascript:void(0)" class="share1"></a><span></span></li>';
share_html += '<li title="分享到新浪微博"><a href="javascript:void(0)" class="share2"></a><span></span></li>';
share_html += '<li title="分享到人人網(wǎng)"><a href="javascript:void(0)" class="share3" ></a><span></span></li>';
share_html += '<li title="分享到朋友網(wǎng)"><a href="javascript:void(0)" class="share4"></a><span></span></li>';
share_html += '<li title="分享到騰訊微博"><a href="javascript:void(0)" class="share5"></a><span></span></li>';
share_html += '<li title="分享到開心網(wǎng)"><a href="javascript:void(0)" class="share6"></a><span></span></li>';
share_html += '</ul></div>';
$('body').prepend(share_html);
$('.share').SmohanPopLayer({Shade : true,Event:'click',Content : 'Share', Title : '分享Smohan到各大社區(qū)'});
$('#Share li').each(function() {
$(this).hover(function(e) {
$(this).find('a').animate({ marginTop: 2}, 'easeInOutExpo');
$(this).find('span').animate({opacity:0.2},'easeInOutExpo');
},function(){
$(this).find('a').animate({ marginTop: 12}, 'easeInOutExpo');
$(this).find('span').animate({opacity:1},'easeInOutExpo');
});
});
var share_url = encodeURIComponent(location.href);
var share_title = encodeURIComponent(document.title);
var share_pic = "http://www.smohan.net/images/smohan.png"; //默認(rèn)的分享圖片
var share_from = encodeURIComponent("水墨寒個(gè)人官方網(wǎng)站"); //分享自(僅用于QQ空間和朋友網(wǎng),新浪的只需更改appkey 和 ralateUid就行)
//Qzone
$('#Share li a.share1').click(function(e) {
window.open("http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url="+share_url+"&title="+share_title+"&pics="+share_pic+"&site="+share_from+"","newwindow");
});
//Sina Weibo
$('#Share li a.share2').click(function(e) {
var param = {
url:share_url ,
appkey:'678438995',
title:share_title,
pic:share_pic,
ralateUid:'3061825921',
rnd:new Date().valueOf()
}
var temp = [];
for( var p in param ){
temp.push(p + '=' + encodeURIComponent( param[p] || '' ) )
}
window.open('http://v.t.sina.com.cn/share/share.php?' + temp.join('&'));
});
//renren
$('#Share li a.share3').click(function(e) {
window.open('http://widget.renren.com/dialog/share?resourceUrl='+share_url+'&title='+share_title+'&images='+share_pic+'','newwindow');
});
//pengyou
$('#Share li a.share4').click(function(e) {
window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?to=pengyou&url='+share_url+'&pics='+share_pic+'&title='+share_title+'&site='+share_from+'','newwindow');
});
//tq
$('#Share li a.share5').click(function(e) {
window.open('http://share.v.t.qq.com/index.php?c=share&a=index&title='+share_title+'&site='+share_from+'&pic='+share_pic+'&url='+share_url+'','newwindow');
});
//kaixin
$('#Share li a.share6').click(function(e) {
window.open('http://www.kaixin001.com/repaste/bshare.php?rtitle='+share_title+'&rurl='+share_url+'&from=水墨寒個(gè)人官方網(wǎng)站','newwindow');
});
});
/*加入收藏*/
function addfavorite(){
var Url = "http://www.smohan.net";
var Title = "水墨寒個(gè)人官網(wǎng)";
if(document.all){
window.external.addFavorite(Url,Title);
}else if(window.sidebar){
window.sidebar.addPanel(Title,Url,"");
}else{
alert("請(qǐng)使用Ctrl+D鍵導(dǎo)入書簽!");
}
}
您可能感興趣的文章:
- jQuery彈出層插件popShow用法示例
- jQuery Dialog 彈出層對(duì)話框插件
- JQUERY THICKBOX彈出層插件
- jQuery彈出層插件簡化版代碼下載
- Jquery 彈出層插件實(shí)現(xiàn)代碼
- 基于jquery的blockui插件顯示彈出層
- jquery.artwl.thickbox.js 一個(gè)非常簡單好用的jQuery彈出層插件
- jQuery插件zoom實(shí)現(xiàn)圖片全屏放大彈出層特效
- 一個(gè)jquery的彈出層的插件
- jQuery boxy彈出層插件中文演示及使用講解
- js彈出層(jQuery插件形式附帶reLoad功能)
- jQuery彈出層插件Lightbox_me使用指南
- Jquery彈出層插件ThickBox的使用方法
- jQuery彈出層插件popShow(改進(jìn)版)用法示例
相關(guān)文章
jQuery中的Deferred和promise 的區(qū)別
這篇文章主要介紹了jQuery中的Deferred和promise 的區(qū)別的相關(guān)資料,需要的朋友可以參考下2016-04-04
firefox下jQuery UI Autocomplete 1.8.*中文輸入修正方法
在FF下,切換到中文輸入法,再輸入中文,是不能立即自動(dòng)查詢,需要按下其他按鍵,比如CTRL,后來,通過修改源代碼即可修復(fù)這個(gè)問題2012-09-09
jquery 單引號(hào)和雙引號(hào)的區(qū)別及使用注意
在js中單引號(hào)和雙引號(hào)都是一樣的,平時(shí)使用的時(shí)候盡量用單引號(hào),只有碰到嵌套的時(shí)候才會(huì)同時(shí)用兩種引號(hào),感興趣的朋友可以了解下2013-07-07
jQuery插件HighCharts實(shí)現(xiàn)的2D對(duì)數(shù)餅圖效果示例【附demo源碼下載】
這篇文章主要介紹了jQuery插件HighCharts實(shí)現(xiàn)的2D對(duì)數(shù)餅圖效果,結(jié)合實(shí)例形式分析了jQuery圖形插件HighCharts繪制2D對(duì)數(shù)餅圖的具體實(shí)現(xiàn)步驟與相關(guān)操作技巧,并附帶demo源碼供讀者下載參考,需要的朋友可以參考下2017-03-03
jQuery 學(xué)習(xí)6 操縱元素顯示效果的函數(shù)
jQuery提供了hide() ,show()對(duì)元素進(jìn)行隱藏和顯示,下面看兩個(gè)函數(shù)的應(yīng)用2010-02-02
淺談jquery點(diǎn)擊label觸發(fā)2次的問題
下面小編就為大家?guī)硪黄獪\談jquery點(diǎn)擊label觸發(fā)2次的問題。小編覺得挺不錯(cuò)的,現(xiàn)在就分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2016-06-06

