{"id":19274011,"url":"https://github.com/rintoj/callout","last_synced_at":"2026-05-18T07:31:27.300Z","repository":{"id":26770275,"uuid":"30228300","full_name":"rintoj/callout","owner":"rintoj","description":"This is an implementation of tooltip. The tooltip can render any HTML content within and the arrow's direction can be configured. This module is capable of rearranging the position to a best suited place based on preferred and allowed locations.","archived":false,"fork":false,"pushed_at":"2015-04-18T15:11:48.000Z","size":1036,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-02T22:45:40.137Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rintoj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-03T06:15:09.000Z","updated_at":"2016-12-24T15:45:52.000Z","dependencies_parsed_at":"2022-09-01T19:01:29.108Z","dependency_job_id":null,"html_url":"https://github.com/rintoj/callout","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rintoj/callout","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rintoj%2Fcallout","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rintoj%2Fcallout/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rintoj%2Fcallout/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rintoj%2Fcallout/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rintoj","download_url":"https://codeload.github.com/rintoj/callout/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rintoj%2Fcallout/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33169175,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T20:44:48.722Z","updated_at":"2026-05-18T07:31:27.281Z","avatar_url":"https://github.com/rintoj.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"* * *\n\n## Class: Callout\n\nThis is an implementation of tooltip. The tooltip can render any HTML content within and the arrow's direction can be configured. This module is capable of rearranging the position to a best suited place based on preferred and allowed locations.\n\n### Usage\n\n    var callout = new Callout({\n        content: \"I'm callout\",\n        size: {\n            width: 150,\n            height: 20\n        },\n        autohide: true\n    });\n\n    $(\".targetNode\").on(\"click\", function () {\n        callout.show(this, [\"top\"]); // show on top if possible\n    });\n\n    $(\"body\").on(\"contextmenu\", function(event) {\n        callout.show(event);\n        event.preventDefault();\n    });\n\n### Resources\n\n    \u003clink rel=\"stylesheet\" href=\"css/callout.css\"\u003e\n    \u003cscript src=\"js/src/Callout.js\"\u003e\u003c/script\u003e\n\n### Dependency\n\n    \u003cscript src=\"js/lib/jquery-2.1.1.js\"\u003e\u003c/script\u003e\n\n* * *\n\nAPI\n---\n\n## Constructor: new Callout(options)\n\n**Options**\n\n**content**: `String`, Specify content for the callout within this member.\n\n**theme**: `String`, Theme. Valid values are 'dark', 'light', 'default'. Default value is 'default'\n\n**size**: `Object`, Expect an object with 'width' and 'height'. Eg: {width: 25, height: 25}\n\n**autohide**: `Booean`, If set to true callout will be made hidden when focus is lost; default value is true.\n\n**container**: `String | Node`, If specified, callout will try to position itself within the specified dom node; default value is body\n\n**preferredLocations**: `Array`, The preferred locations of callout. This must be a subset of allowed location. Any other value will be\nignored.\n\n**allowedLocations**: `Array`, Locations that are allowed for the callout. Valid values are \"top\", \"top-left\", \"top-right\", \"right\", \"right-top\", \"right-bottom\", \"bottom\", \"bottom-right\", \"bottom-left\", \"left\", \"left-top\", \"left-bottom\"\n\n## show(target, preferredLocations) \n\nShow callout and position it around a view port or a node. All the valid positions from the preferred\nlocations and the reset of the positions from the allowed positions will be iterated until a position is\nfound that places callout's viewport within the container's view port without overflowing. If no suitable\nposition the callout is place within the target node.\n\n**Parameters**\n\n**target**: `Node | jQuery.Event`, (Mandatory) Dom node or an instance of jQuery.Event\n\n**preferredLocations**: `Array`, (optional) Array of prefered locations;\n\n**Returns**: `Callout`, Returns 'this' to enable method chaining\n\n## hide() \n\nHide callout.\n\n**Returns**: `Callout`, Returns 'this' to enable method chaining.\n\n## remove() \n\nRemove callout from DOM\n\n**Returns**: `Callout`, Returns 'this' to enable method chaining\n\n## getDomNode() \n\nReturn the root node of callout. To avoid unexpected behaviour do NOT manipulate this node\n\n**Returns**: `Object`, The node object\n\n## getContentNode() \n\nGet content node. Attach your content into this node.\n\n**Returns**: `Object`, Content node\n\n**Example**:\n```js\ncallout.getContentNode().html(\"This is a tooltip\"); // setting text\ncallout.getContentNode().append(bannerNode); // setting inner node\n```\n\n## setContent(content) \n\nSet content of the callout.\n\n**Parameters**\n\n**content**: `String`, The content as string\n\n**Returns**: `Callout`, Returns 'this' to enable method chaining\n\n## getArrow() \n\nGet current direction of arrow\n\n**Returns**: `String`, Returns direction of arrow\n\n## setArrow(direction) \n\nSet direction of arrow\n\n**Parameters**\n\n**direction**: `String`, All possible values for 'allowedLocations' are valid here\n\n**Returns**: `Callout`, Returns 'this' to enable method chaining\n\n## getContainer() \n\nGet container\n\n**Returns**: `Node | String`, Returns 'container'\n\n## setContainer(container) \n\nContainer node for the callout. The view port of the callout will be\nalways calculated to be with in container's view port.\n\n**Parameters**\n\n**container**: `Object`, The container node\n\n**Returns**: `Callout`, Returns 'this' to enable method chaining\n\n## getAutoHide() \n\nCheck if auto hide is on or off\n\n**Returns**: `Boolean`, Returns 'true' if auto hide is on\n\n## setAutoHide(autohideOn) \n\nTurn on/off auto hide. Auto hide feature will hide the callout\nwhen focus is removed\n\n**Parameters**\n\n**autohideOn**: `Boolean`, True to turn on auto hide.\n\n**Returns**: `Callout`, Returns 'this' to enable method chaining\n\n## getPreferredLocations() \n\nGet preferred locations.\n\n**Returns**: `Array`, Array of locations that are preferred\n\n## setPreferredLocations(preferredLocations) \n\nSet preferred locations for the callout. Eg. [\"right\"] will place\ncallout on the right side of the attached node with left arrow.\nHowever this location will be ignored if the calculated view port\nis outside containerNode's view port.\n\n**Parameters**\n\n**preferredLocations**: `Array`, Array of preferred locations\n\n**Returns**: `Callout`, Returns 'this' to enable method chaining\n\n## getAllowedLocations() \n\nGet allowed locations.\n\n**Returns**: `Array`, Array of locations that are allowed\n\n## setAllowedLocations(allowedLocations) \n\nSet the allowed locations for the callout. This is the final list of locations allowed for\ncallout. Any value outside this list, if used in preferred locations, will be ignored.\n\n**Parameters**\n\n**allowedLocations**: `Array`, Array of allowed locations\n\n**Returns**: `Callout`, Returns 'this' to enable method chaining\n\n## getTheme() \n\nGet theme.\n\n**Returns**: `String`, Theme.\n\n## setTheme(theme) \n\nSet theme. Valid values are 'dark', 'light', 'normal'\n\n**Parameters**\n\n**theme**: `String`, Valid values are 'dark', 'light', 'normal'\n\n**Returns**: `Callout`, Returns 'this' to enable method chaining\n\n## getSize() \n\nGet size of the callout.\n\n**Returns**: `Object`, An object in the format {width: Number, height: Number}.\n\n## setSize(width, height) \n\nSet size of the callout\n\n**Parameters**\n\n**width**: `Number`, Width in pixels\n\n**height**: `Number`, height in pixels\n\n**Returns**: `Callout`, Returns 'this' to enable method chaining\n\n\n\n* * *\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frintoj%2Fcallout","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frintoj%2Fcallout","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frintoj%2Fcallout/lists"}