{"id":17138040,"url":"https://github.com/moagrius/isonscreen","last_synced_at":"2025-04-13T09:52:18.126Z","repository":{"id":18974563,"uuid":"22195640","full_name":"moagrius/isOnScreen","owner":"moagrius","description":"Simple jQuery plugin to determine if an element is within the viewport","archived":false,"fork":false,"pushed_at":"2018-01-10T15:59:41.000Z","size":9,"stargazers_count":120,"open_issues_count":0,"forks_count":29,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-04-10T13:36:37.042Z","etag":null,"topics":["jquery","jquery-plugin","position","viewport","visibility"],"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/moagrius.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-07-24T02:56:06.000Z","updated_at":"2024-12-22T13:18:25.000Z","dependencies_parsed_at":"2022-07-22T19:24:58.032Z","dependency_job_id":null,"html_url":"https://github.com/moagrius/isOnScreen","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moagrius%2FisOnScreen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moagrius%2FisOnScreen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moagrius%2FisOnScreen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moagrius%2FisOnScreen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moagrius","download_url":"https://codeload.github.com/moagrius/isOnScreen/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248695302,"owners_count":21146952,"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":["jquery","jquery-plugin","position","viewport","visibility"],"created_at":"2024-10-14T20:08:37.026Z","updated_at":"2025-04-13T09:52:18.105Z","avatar_url":"https://github.com/moagrius.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#jQuery.isOnScreen\n\nSimple jQuery plugin to determine if an element is positioned within the viewport.  It does not test any other type of \"visibility\", like css display, opacity, presence in the dom, etc - it only considers position.\n\nCurrent version returns true if at least 1 pixel is visible on screen.  \n\nAn optional callback argument is accepted, that is passed the number of pixels visible on each edge - the return of that callback is used, if provided.  The callback is called from the scope of the current node.\n\nSome examples:\n\nReturns true if element has at least 1 pixel within the viewport:\n\n    $('selector').isOnScreen();\n\nReturns true if at least the top 10px of the element's vertical area is in the viewport:\n    \n    $('selector').isOnScreen(function(deltas){\n      return deltas.top \u003e= 10 \u0026\u0026 deltas.bottom \u003e= 10;\n    });\n    \nReturns true if at least the top 10px of the element's vertical area above the bottom of the viewport.\n    \n    $('selector').isOnScreen(function(deltas){\n      return deltas.top \u003e= 10;\n    });  \n      \nReturns true if the element is within 100px of the bottom of the viewport (and so technically is still not \"visible\" - this can be useful for loading content when you expect a user to see it shortly, for example during a fling action or in an infinite scroll application).\n    \n    $('selector').isOnScreen(function(deltas){\n      return deltas.top \u003e= -100;\n    });          \n      \nReturns true if the element's vertical space is entirely within the viewport:    \n    \n    $('selector').isOnScreen(function(deltas){\n      return deltas.top \u003e= this.height() \u0026\u0026 deltas.bottom \u003e= this.height();\n    });\n    \nReturn true if the element is entirely within the viewport:\n\n    $('selector').isOnScreen(function(deltas){\n      return deltas.top \u003e= this.height() \n        \u0026\u0026 deltas.bottom \u003e= this.height()\n        \u0026\u0026 deltas.left \u003e= this.width()\n        \u0026\u0026 deltas.right \u003e= this.width()\n    });\n    \nReturns true if the element is above the bottom of the viewport at all (at least 1 pixel is showing, or the element is above the viewport and not actually visible).\n    \n    $('selector').isOnScreen(function(deltas){\n      return deltas.top \u003e= 0;\n    });\n    \n    ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoagrius%2Fisonscreen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoagrius%2Fisonscreen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoagrius%2Fisonscreen/lists"}