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
Name | Type | Default | Comments |
---|---|---|---|
url | string | '' | The URL for the page to be bookmarked. Leave blank for the URL of the current page. Since 1.1.2. |
sourceTag | string | '' | 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. |
title | string | '' | 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. |
description | string | '' | 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. |
sites | string[] | [] | 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.
Since 1.3.1 - language selectors. Since 1.3.2 - category selectors. |
iconsStyle | string | '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.
This setting was added for performance reasons - some browsers load the
icons image multiple times, once for each site shown.Since 1.2.0. |
icons | string | '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. |
iconSize | number | 16 | The pixel size of the individual icons in the iconsStyle
or icons images. Since 1.0.1. |
iconCols | number | 16 | The number of individual icons across the iconsStyle
or icons images.
This allows for a more compact image. Since 1.1.3. |
target | string | '_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. |
compact | boolean | true | 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. |
hint | string | '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. |
popup | boolean | false | Indicate whether or not the bookmarks should appear on demand (true)
or should always be shown (false). Since 1.1.0. |
popupText | string | 'Bookmark this site...' | The display text for the popup trigger.
You can include HTML markup here - even inserting an image instead of text.
Since 1.1.0. |
addFavorite | boolean | false | 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. |
favoriteText | string | 'Favorite' | The display text for the 'Add to favourites' link. |
favoriteIcon | string or number | 0 | 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. |
addEmail | boolean | false | 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. |
emailText | string | 'E-mail' | The display text for the 'E-mail to a friend' link. |
emailIcon | string or number | 1 | 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. |
emailSubject | string | 'Interesting page' | The subject for the e-mail to be sent out. |
emailBody | string | '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. |
manualBookmark | string | '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. |
addShowAll | boolean | false | 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. |
showAllText | string | '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. |
showAllIcon | string or number | 2 | 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. |
showAllTitle | string | 'All bookmarking sites' | The title for the 'Show all' popup list. Since 1.4.0. |
onSelect | function | null | 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.
Since 1.3.0. |
addAnalytics | boolean | false | 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. |
analyticsName | string | '/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. |