{"id":48551283,"url":"https://github.com/tianxiangbing/tip","last_synced_at":"2026-04-08T08:31:14.008Z","repository":{"id":33660773,"uuid":"37313301","full_name":"tianxiangbing/tip","owner":"tianxiangbing","description":"提示组件","archived":false,"fork":false,"pushed_at":"2021-05-17T03:35:49.000Z","size":516,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-23T19:36:33.963Z","etag":null,"topics":["hover","jquery","tips","title"],"latest_commit_sha":null,"homepage":"http://tianxiangbing.github.io/tip/example/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tianxiangbing.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-06-12T09:19:52.000Z","updated_at":"2021-05-17T03:35:51.000Z","dependencies_parsed_at":"2022-07-25T19:02:22.179Z","dependency_job_id":null,"html_url":"https://github.com/tianxiangbing/tip","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/tianxiangbing/tip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tianxiangbing%2Ftip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tianxiangbing%2Ftip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tianxiangbing%2Ftip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tianxiangbing%2Ftip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tianxiangbing","download_url":"https://codeload.github.com/tianxiangbing/tip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tianxiangbing%2Ftip/sbom","scorecard":{"id":884404,"data":{"date":"2025-08-11","repo":{"name":"github.com/tianxiangbing/tip","commit":"93d687916fd52f836dc2e98d393ab80915be2112"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-24T09:29:26.259Z","repository_id":33660773,"created_at":"2025-08-24T09:29:26.259Z","updated_at":"2025-08-24T09:29:26.259Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31547668,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"online","status_checked_at":"2026-04-08T02:00:06.127Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["hover","jquery","tips","title"],"created_at":"2026-04-08T08:31:12.404Z","updated_at":"2026-04-08T08:31:13.943Z","avatar_url":"https://github.com/tianxiangbing.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tip\njquery提示组件,动态内容tip,右键菜单tip提示\n效果如下图:\n![tip效果图](example/tip.jpg)\n**[DEMO请案例点击这里查看.](http://tianxiangbing.github.io/tip/example/ \"tip demo\")**\n\n----------\n```\nnpm install jq-tip --save\n```\n\n# 调用示例\n\t\u003ctable style=\"width:100%;\"\u003e\u003ctr\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cinput type=\"button\" value=\"右边hover\" id=\"btn-tip-right\"\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cinput type=\"button\" value=\"左边click\" id=\"btn-tip-left\"\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cinput type=\"button\" value=\"上边click\" id=\"btn-tip-top\"\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd\u003e\n\t\t\t\u003cinput type=\"button\" value=\"下边click\" id=\"btn-tip-bottom\"\u003e\n\t\t\u003c/td\u003e\n\t\t\u003ctd align=\"right\"\u003e\n\t\t\t\u003cinput type=\"button\" value=\"按边界click自动\" id=\"btn-tip-auto\"\u003e\n\t\t\u003c/td\u003e\n\t\u003c/tr\u003e\u003c/table\u003e\n\t文本提示：\u003cinput type=\"text\" id=\"txt-tip\" msg=\"请输入内容\"\u003e\n\t\u003cscript type=\"text/javascript\" src=\"../src/jquery-1.11.2.js\"\u003e\u003c/script\u003e\n\t\u003cscript type=\"text/javascript\" src=\"../src/tip.js\"\u003e\u003c/script\u003e\n\t\u003cscript\u003e\n\t\tvar tip = new Tip();\n\ttip.init({\n\t\ttrigger: '#btn-tip-right',\n\t\twidth:100,\n\t\ttriggerEvent:'hover',\n\t\tcontent: 'loading...',\n\t\tajax: function() {\n\t\t\tvar dtd = $.Deferred(); // 新建一个deferred对象\n\t\t\tvar wait = function(dtd) {\n\t\t\t\tvar tasks = function() {\n\t\t\t\t\tconsole.log(\"执行完毕！\");\n\t\t\t\t\tdtd.resolve(\"这是提示信息啊这是提示信息啊这是提示信息啊这是提示信息啊这是提示信息啊这是提示信息啊\"); // 改变deferred对象的执行状态\n\t\t\t\t};\n\t\t\t\tsetTimeout(tasks, 1000);\n\t\t\t\treturn dtd;\n\t\t\t};\n\t\t\twait(dtd);\n\t\t\treturn dtd;\n\t\t}\n\t});\n\tvar tip_left= new Tip();\n\ttip_left.init({\n\t\ttrigger:'#btn-tip-left',\n\t\ttriggerEvent:'click',\n\t\twidth:100,\n\t\tcontent: '这是提示信息啊这这是提示信息啊这是提示信息啊这是提示信息啊是提示信息啊这是提示信息啊',\n\t\tposition:'left|bottom'\n\t\t});\n\tvar tip_top= new Tip();\n\ttip_top.init({\n\t\ttrigger:'#btn-tip-top',\n\t\ttriggerEvent:'click',\n\t\tcontent: '这是提示信息啊',\n\t\tposition:'top|left'\n\t\t});\n\tvar tip_bottom= new Tip();\n\ttip_bottom.init({\n\t\ttrigger:'#btn-tip-bottom',\n\t\ttriggerEvent:'click',\n\t\tcontent: '这是提示信息啊',\n\t\tposition:'bottom|left'\n\t\t});\n\tvar tip_auto= new Tip();\n\ttip_auto.init({\n\t\ttrigger:'#btn-tip-auto',\n\t\ttriggerEvent:'click',\n\t\twidth:100,\n\t\tposition:'right|center',\n\t\tcontent: '这是提示信息啊这这是提示信息啊这是提示信息啊这是提示信息啊是提示信息啊这是提示信息啊',\n\t\tinViewport:true\n\t\t});\n\tvar t = $('#txt-tip').Tip({\n\t\tcontent:$('#txt-tip').attr('msg'),\n\t\ttriggerEvent:'focus'\n\t})[0];\n\t$('#table :button').each(function() {\n\t\tvar obj = this;\n\t\tvar t = new Tip();\n\t\tt.init({\n\t\t\ttrigger: obj,\n\t\t\ttriggerEvent: 'hover',\n\t\t\twidth: 150,\n\t\t\tposition: $(obj).data('position'),\n\t\t\tcontent: '这是提示信息啊这这是提示信息啊这是提示信息啊这是提示信息啊是提示信息啊这是提示信息啊',\n\t\t\tinViewport: true,\n\t\t\tbeforeShow:function(){\n\t\t\t\t$('.ui-tip').trigger('hide');\n\t\t\t}\n\t\t});\n\t});\n\t//rightMouseTarget有值时，触发鼠标右键菜单事件。 this.settings.trigger为当前的dom对象。方便动态内容时使用.\n\tvar tipajax = new Tip();\n\ttipajax.init({\n            trigger: '#btn-tip-ajax',\n            delegate:document,\n            triggerEvent:'click',\n            position:'bottom|left',\n            content: ' ',\n\t\t\toffset:{x:-10,y:0},\n\t\t\trightMouseTarget:'body',\n            ajax: function(target) {\n\t\t\t\tvar dtd = $.Deferred(); // 新建一个deferred对象\n                setTimeout(()=\u003e{\n\t\t\t\t\tlet $html=\"\u003cdiv\u003eabcdefg\"+$(target).val()+\"\u003c/div\u003e\"\n\t\t\t\t\tdtd.resolve($html); \n\t\t\t\t});\n\t\t\t\treturn dtd;\n\t\t\t}\n\t\t})\n\t\t//使用content函数来动态设置内容，或者在callback中使用setContent设置内容\n\t\tvar tipaAni = new Tip();\n\t\ttipaAni.init({\n            trigger: '#btn-tip-anim',\n            delegate:document,\n            triggerEvent:'click',\n            position:'bottom|left',\n\t\t\trightMouseTarget:'body',\n            content: function(target){\n\t\t\t\tlet $html=\"\u003cdiv\u003eabcdefg\"+$(target).val()+\"\u003c/div\u003e\"\n\t\t\t\treturn $html;\n\t\t\t},\n\t\t\toffset:{x:-10,y:0},\n\t\t\trightMouseTarget:'body'\n\t\t})\n\t\u003c/script\u003e\n\n# API\n## 属性\n### trigger:`[$|dom|string]`\n\t触发元素,jquery对象或dom或string,当delegate不为空时，trigger只支持string.\n### triggerEvent: `[click|hover|focus]`\n\t触发事件，默认为hover,事件都委托在delegate参数上，focus不委托\n### delegate:`[dom|string]`\n\t事件的委托节点,默认无委托,focus无效.\n### tpl:`[string]`\n\thtml模板，默认\u003cdiv class=\"ui-tip\"\u003e\u003cdiv class=\"ui-tip-content\"\u003e\u003c/div\u003e\u003cdiv class=\"ui-tip-arrow\"\u003e\u003ci\u003e\u003c/i\u003e\u003cem\u003e\u003c/em\u003e\u003c/div\u003e\u003c/div\u003e\n### offset:`{x:0,y:0}`\n\t偏移量,默认x:0,y:0\n### width:`[number]`\n\t宽\n### height:`[number]`\n\t高\n### zIndex:`999`\n\tz-index\n### content:[string|$]\n\t提示内容，这里可以是string或节点，因为内部是调用的$().html方法,动态设置请调setContent方法\n### inViewport:`bool`\n\t是否自适合窗口位置,默认false\n### position:`['right'|'left'|'top'|'bottom']`\n\t显示位置，默认'right\n### ajax:`function`\n\t返回一个promise,参数为promise之后的内容如下：\n\tajax: function() {\n\t\tvar dtd = $.Deferred(); // 新建一个deferred对象\n\t\tvar wait = function(dtd) {\n\t\t\tvar tasks = function() {\n\t\t\t\tconsole.log(\"执行完毕！\");\n\t\t\t\tdtd.resolve(\"这是提示信息啊\"); // 改变deferred对象的执行状态\n\t\t\t};\n\t\t\tsetTimeout(tasks, 1000);\n\t\t\treturn dtd;\n\t\t};\n\t\twait(dtd);\n\t\treturn dtd;\n\t}\n## 方法\n### setContent:`function(content)`\n\t设置提示内容\n### stop:`function()`\n\t停止显示\n### start:`function`\n\t开始显示\n## 事件或回调\n### callback:`function`\n\t显示后的回调\n### hide:`event`\n\ttip的hide事件，\n### beforeShow:`function`\n\t显示前的回调\n### afterHide:`function`\n\t隐藏后的回调","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftianxiangbing%2Ftip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftianxiangbing%2Ftip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftianxiangbing%2Ftip/lists"}