Selected text sharer ← Javascripts

- 676 views - 1 Comment

Selected text sharer is a promoting and enhancing javascript focusing to increase the site usage. This javascript displays a widget having links to search / share, above the selected text. Inspired from NY times web site.


  • Features
  • Demo
  • Documentation
  • Download


  • Cross browser supported.
  • Highly customisable interface.
  • Light-weight.
  • Can add unlimited links to the widget for searching and sharing.
  • Selected text truncation for Twitter.
  • Can show widget for textboxes and textareas also.
  • Available in Jquery version also.

Donate and show your love

If you find this project useful, please consider a donation. It gives me encouragement and support !


Click the button below to view the example and demonstrations of selected text sharer.


Click the button below to download.

(Selected Text Sharer - Js, 5.9 KiB, 516 hits)


Basic Usage

var sts_config = {
	title : 'Share this text ...',	// Title of the widget
	lists : 'Google,, favicon',	// Links for searching / sharing
	truncateChars : 115,		// Number of characters to truncate for twitter.
	extraClass : 'someClass',	// Additional class for customizing the widget.
	borderColor : '#444',		// Color of the border
	background : '#fff',		// Background color
	titleColor : '#f2f2f2',		// Title Background color
	hoverColor : '#ffffcc',		// Links hover color
	textColor : '#000'		// Text color

Adding search/share Links

A single links requires three values. They are Name of the Link, URL, Icon URL. The variable %s should be inserted in the search / share URL to get the selected text. Additionaly, %ts can also be used to get the truncated selected text.

Also, favicon can be used instead of Icon URL to automatically get the Icon

Google,, favicon

Adding multiple links

Multiple links can be added by joining the individual link by "|"

Google,, favicon | Twitter, ,favicon | Wikipedia ,,favicon

These links should be the value of the property "lists"

Add your comment 1 Comment so far