2010 Mar 21

Sharethis jQuery Plugin

Introduction

A jquery plugin that enable sharing anywhere.

This plugin needs fancybox lightbox effect! You can change it by editing lightbox function in sharethis.js to use you own lightbox effect.
A wordpress plugin that integra this scirpt is avaliable on : http://pagetalks.com/2010/03/21/wordpress-plugin-free-share.html

添加“分享”按钮到你想要的地方。
这个插件需要fancybox的lightbox效果! 你也可以自己更改自己为自己的lightbox效果。
使用该脚本的Wordpress的插件可以在这里找到 : http://pagetalks.com/2010/03/21/wordpress-plugin-free-share.html

Download

  sharethis.zip (63.2 KiB, 672 hits)

Markups

<a href="the link you want to share" class="sharethis-button" rel="Title of the page you want ot share">Share</a>

By default, it will share this link in href attribute, and use rel attribute as title of the share.
If you leave these two attribute blank, it will take path in location bar as link, and title of current page as the title of the share.

Installation

  1. Include fancybox scripts! or use your own lightbox effect
  2. Include sharethis.js and sharethis.css

By default, it will listen for click events on any element with a “sharethis-button” class to display a dialog.

Parameters

iconPath (String)
the path for icons of social sites
lightbox (function)
your own implementation of lightbox effect, taking html string “data” as the only argument, e.g.

function(data) {
			$.fancybox(data);
		}
extra (Array)
array that can supplyment the sites array, e.g.

extra : [{name: "XX", url: "XX", icon: "XX.gif"},{name: "XX", url: "XX", icon: "XX.gif"}]

Changelog

1.0
First Release of Sharethis Plugin

下载

  sharethis.zip (63.2 KiB, 672 hits)

HTML标记

<a href="the link you want to share" class="sharethis-button" rel="Title of the page you want ot share">Share</a>

默认状态下,它将把href属性当作你要分享的链接地址,rel属性当作分享的标题。
如果你没有设置这两个属性,那么它就将当前页面的地址和标题当作默认属性。

安装

  1. 引用fancybox的脚本,或者自定义自己的lightbox效果
  2. 引用sharethis.js和sharethis.css

默认情况下它会监听所有“sharethis-button”类的点击行为,并激活分享对话框。

Parameters

iconPath (String)
the path for icons of social sites
lightbox (function)
lightbox的接口函数,调用时会传递一个data的html代码字符串,例如:

function(data) {
			$.fancybox(data);
		}
extra (Array)
补充社交站点的数组, 例如.

extra : [{name: "XX", url: "XX", icon: "XX.gif"},{name: "XX", url: "XX", icon: "XX.gif"}]

更新日志

1.0
第一个发行版本

Post a Comment

Your email is never shared. Required fields are marked *

*
*