Instance Settings

Customise each targetted div or span with the settings below (all are optional):

$(selector).bookmark({sites: ['delicious', 'reddit']});

addAnalytics | addEmail | addFavorite | addShowAll | analyticsName | compact | description | emailBody | emailIcon | emailSubject | emailText | favoriteIcon | favoriteText | hint | iconCols | icons | iconSize | iconsStyle | manualBookmark | onSelect | popup | popupText | showAllIcon | showAllText | showAllTitle | sites | sourceTag | target | title | url

NameTypeDefaultComments
urlstring'' The URL for the page to be bookmarked. Leave blank for the URL of the current page.

Since 1.1.2.
sourceTagstring'' The name of an additional tag to be appended to the URL so that traffic from that source can be tracked. For example, a value of 'from' would add from=siteID to the URL being bookmarked as a query parameter, where siteID is the ID of the selected site. Leave blank to not add anything.

Since 1.3.0.
titlestring'' The title of the page to be bookmarked. Leave blank for the title of the current page, or the text of the first h1 if there is no title. Not all sites accept this value.

Since 1.1.2.
Since 1.3.2 - use of h1 text.
descriptionstring'' A longer description of the page. The meta description text is used if no value is specified. Not all sites accept this value.

Since 1.3.0.
Since 1.3.2 - use of meta description text.
sitesstring[][] List the IDs or language or category selectors of the bookmarking sites to include. Language selectors are of the form 'lang:xx', where 'xx' is the standard ISO 639-1 language code. Category selectors are of the form 'category:yy'. Alternately, you can use the commonSites constant for a list of the more common bookmarking sites. If none are specified, all sites are shown.

$(selector).bookmark({sites: ['digg', 'furl']});
$(selector).bookmark({sites: ['lang:ja', 'lang:ko']});
$(selector).bookmark({sites: ['category:shopping']});
$(selector).bookmark({sites: $.bookmark.commonSites});

Since 1.3.1 - language selectors.
Since 1.3.2 - category selectors.
iconsStylestring'bookmark_icons' The CSS class to apply to the icon containers for the standard bookmarking sites. The style should apply a background image of an amalgamation of all the individual icons - counting from zero at the top/left, with iconCols icons across. The default style assumes that the CSS resides in a css directory with the images in an img directory at the same level.
.bookmark_list span.bookmark_icons {
	background: url(../img/bookmarks.gif)
		no-repeat center;
}
This setting was added for performance reasons - some browsers load the icons image multiple times, once for each site shown.

Since 1.2.0.
iconsstring'bookmarks.gif' The location (URL) of the icons for the standard bookmark sites. This image is an amalgamation of all the individual icons - counting from zero at the top/left, with iconCols icons across. This value is only used if iconsStyle is blank. The latter should be used in preference to this setting for performance reasons.
iconSizenumber16 The pixel size of the individual icons in the iconsStyle or icons images.

Since 1.0.1.
iconColsnumber16 The number of individual icons across the iconsStyle or icons images. This allows for a more compact image.

Since 1.1.3.
targetstring'_blank' The name of the window in which the bookmark links are opened. The default opens in a new tab/window. Set to '' to replace the current window.
compactbooleantrue Set to true to display the links in a compact format using only the icons. When false, the icon and display name are shown in separate 'buttons'.

Since 1.1.0 - default is true, previously it was false.
hintstring'Send to {s}' A template for popup hints on the site icons. '{s}' is replaced by the site's display name.

Since 1.1.2.
booleanfalse Indicate whether or not the bookmarks should appear on demand (true) or should always be shown (false).

Since 1.1.0.
popupTextstring'Bookmark this site...' The display text for the popup trigger. You can include HTML markup here - even inserting an image instead of text.
$(selector).bookmark({popup: true,
	popupText: '<img src="bookmarkthis.png" ' +
		'alt="Bookmark this..."/>'});
Since 1.1.0.
addFavoritebooleanfalse Indicate whether or not an 'Add to favourites' link should be included. This adds the current page to the browser's bookmarks when clicked in Internet Explorer, and provides manual instructions on how to do this for other browsers.
favoriteTextstring'Favorite' The display text for the 'Add to favourites' link.
favoriteIconstring or number0 The URL of the icon to use for the 'Add to favourites' link, or the index of the 'Favorite' icon within the iconsStyle or icons images.
addEmailbooleanfalse Indicate whether or not an 'E-mail to a friend' link should be included. This prepares an e-mail about the current page when clicked.
emailTextstring'E-mail' The display text for the 'E-mail to a friend' link.
emailIconstring or number1 The URL of the icon to use for the 'E-mail to a friend' link, or the index of the 'E-mail' icon within the iconsStyle or icons images.
emailSubjectstring'Interesting page' The subject for the e-mail to be sent out.
emailBodystring 'I thought you might find this page interesting:\n{t} ({u})' The body for the e-mail to be sent out. Use '{t}' to mark the position where the title of the current page is inserted, '{u}' to mark where the current page's URL should appear, '{d}' to mark the location of the description, and '\n' to mark new lines.
manualBookmarkstring 'Please close this dialog and\npress Ctrl-D to bookmark this page.' The text to display for manually bookmarking a page within the browser. Used for browsers other than Internet Explorer. Use '\n' to mark new lines.
addShowAllbooleanfalse Indicate whether or not a 'Show all' link should be included. This link triggers a popup list of all known bookmarking sites.

Since 1.4.0.
showAllTextstring'Show all ({n})' The display text for the 'Show all' link. Use '{n}' to mark the position where the total number of sites is inserted.

Since 1.4.0.
showAllIconstring or number2 The URL of the icon to use for the 'Show all' link, or the index of the 'Show all' icon within the iconsStyle or icons images.

Since 1.4.0.
showAllTitlestring'All bookmarking sites' The title for the 'Show all' popup list.

Since 1.4.0.
onSelectfunctionnull A callback function upon selection of a bookmarking site. The site ID, display name, and URL are passed in as parameters while this refers to the bookmarks container. The callback is not triggered for favourites or e-mail links.
$(selector).bookmark({onSelect: customBookmark});

function customBookmark(id, display, url) {
	window.open(url, '_blank',
		'width=600,height=400,menubar=no,toolbar=no,scrollbars=yes');
}
Since 1.3.0.
addAnalyticsbooleanfalse Set to true to add a Google Analytics call when following the link. You need to load the Google Analytics code as normal and supply your own key.

Since 1.3.4.
analyticsNamestring'/share/{r}/{s}' The page name to be passed to the Google Analytics call. Within the name use '{u}' to mark the insertion point for the full URL of the current page, '{r}' for the relative URL of the current page (i.e. without the host reference), '{t}' for the current page's title, '{s}' for the ID of the selected bookmarking site, and/or '{n}' for the site's display name.

Since 1.3.4.

Constants

NameTypeComments
$.bookmark.commonSitesstring[] The list of IDs of common bookmarking sites for use with the sites setting.

$(selector).bookmark({sites: $.bookmark.commonSites});

Since 1.4.0.

Functions

addSite | change | destroy | getSites | setDefaults

SignatureReturnsComments
$.bookmark.setDefaults(settings)Bookmark object Update the default instance settings to use with all bookmark instances.

settings (object) is the collection of new settings to apply.
$.bookmark.addSite(id, display, icon, lang, category, url)Bookmark object Add a definition for a new bookmarking site (or overwrite an existing one). The parameters are:

id (string) the identifier for this site;

display (string) the display text for this site;

icon (string) the location (URL) of an icon for this site (size as specified by iconSize setting), or (number) the index into the iconsStyle or icons images (both starting at zero);

lang (string) the ISO 639-1 language code for this site;

category (string) the type classification for this site, current values are: 'blog', 'bookmark', 'mail', 'news', 'other', 'shopping', 'social', 'tools';

url (string) the submission URL for this site. Within the URL use '{u}' to mark the insertion point for the URL of the current page, '{t}' for the current page's title, and '{d}' for the page's description.

$.bookmark.addSite('delicious',
	'del.icio.us', 'delicious.png', 'en', 'bookmark',
	'http://del.icio.us/post?url={u}&title={t}');

Since 1.3.1 - added lang.
Since 1.3.2 - added category.
$.bookmark.getSites()object[] Return details about all the known sites. The array is indexed by the site ID (string). Each object in the array has the following attributes:

display (string) the display text for this site;

icon (string) the location (URL) of an icon for this site (size as specified by iconSize setting), or (number) its index into the iconsStyle or icons images (starting at zero);

lang (string) the ISO 639-1 language code for this site;

category (string) the type classification for this site;

url (string) the submission URL for this site.

$.each($.bookmark.getSites(), function(id, site) {
	// Process each site here
});

Since 1.3.1 - added lang.
Since 1.3.2 - added category.
$(selector).bookmark('change', settings)jQuery object Update the settings for the bookmarking instance attached to the given div(s) or span(s).

settings (object) is the collection of new settings to apply.
$(selector).bookmark('change', name, value)jQuery object Update a single setting for the bookmarking instance attached to the given div(s) or span(s).

name (string) is the name of the setting;

value (any) is the setting value.

Since 1.3.0.
$(selector).bookmark('destroy')jQuery object Remove the bookmarking functionality from the given div(s) or span(s).