{"id":16231552,"url":"https://github.com/hustcc/return-top","last_synced_at":"2025-03-19T14:30:38.972Z","repository":{"id":24454809,"uuid":"27857607","full_name":"hustcc/return-top","owner":"hustcc","description":"Pure javascript achieve click image to return top of website with animation","archived":false,"fork":false,"pushed_at":"2017-01-05T03:30:05.000Z","size":4811,"stargazers_count":20,"open_issues_count":0,"forks_count":13,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-17T07:51:27.041Z","etag":null,"topics":["javascript","return","scrolling"],"latest_commit_sha":null,"homepage":"http://git.hust.cc/x-return-top.js","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/hustcc.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":"2014-12-11T06:34:44.000Z","updated_at":"2025-03-12T10:21:38.000Z","dependencies_parsed_at":"2022-08-22T08:20:22.050Z","dependency_job_id":null,"html_url":"https://github.com/hustcc/return-top","commit_stats":null,"previous_names":["hustcc/x-return-top.js"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Freturn-top","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Freturn-top/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Freturn-top/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hustcc%2Freturn-top/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hustcc","download_url":"https://codeload.github.com/hustcc/return-top/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244094242,"owners_count":20397020,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["javascript","return","scrolling"],"created_at":"2024-10-10T13:06:03.297Z","updated_at":"2025-03-19T14:30:38.494Z","avatar_url":"https://github.com/hustcc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# x-return-top\n\n\n\u003e 纯javascript代码实现的“返回顶部”功能，代码非常简单，集成起来更简单，代码大小只有2.2kb，并且提供CDN，完全不会拖慢你的网站速度。\n\n在制作网页中，经常会发现网页非常长，为了用户的方便，都会设置返回顶部的按钮，用户一键返回网页顶部；\n如果你的网站中使用jquery，那么有很多的插件可以完成这个工作，可以在git中搜索很多。\n\n然而，如果你的网页中没有使用jquery，那么如果要使用这些插件，就必须为了这一个很小的功能，加上jquery，对于网页的加载速度非常不划算。\n\n\n## 使用 ##\n\n使用非常简单，如下所示，放到Body之间即可，切勿放到head中。\n\n\t\u003cscript type=\"text/javascript\" src=\"dist/x-return-top.min.js\"\u003e\u003c/script\u003e\n\n\n## 配置项\n\n - `left`: 位置定位左侧, 默认: `'80%'` \n - `bottom`: 位置定位右侧, 默认: `15%`\n - `text`: 显示的文本内容, 默认: `Back Top`\n\n例如：\n\n\t\u003cscript type=\"text/javascript\" left=\"80%\" bottom=\"20%\" text=\"返回顶部\" src=\"dist/x-return-top.min.js\"\u003e\u003c/script\u003e\n\n\n## 说明 ##\n\n- git上大部分的“返回顶部”项目都是基于jquery，使用前必须应用jquery\n- git上部分纯javascript实现的“返回顶部”，无动画，不美观\n- 本项目使用纯javascript，实现动画，美观且不影响网页加载速度，不依赖任何js框架\n- 压缩之后2.2kb\n- 集成非常简单\n- 使用部分css3动画，所以兼容性你懂的（但是不会影响使用，后续会改为js动画）\n- css使用js动态加载，集成更方便，且不影响网页加载速度\n- 图片使用base64加载，不会增加http请求数\n\n\n## Demo ##\n\n - Live Demo 1: [https://aibq.cn](https://aibq.cn)\n - Live Demo 2: [http://www.atool.org](http://www.atool.org)\n - 项目代码中的index.html\n![](https://raw.githubusercontent.com/hustcc/x-return-top.js/master/screenshot/shot.gif)\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcc%2Freturn-top","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhustcc%2Freturn-top","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhustcc%2Freturn-top/lists"}