Skip to main content
Glama
dom_funcs.ts521 B
export function elementIsScrolledIntoView( el?: HTMLElement, container?: HTMLElement, ) { if (!el || !document.body.contains(el)) return false; const rect = el.getBoundingClientRect(); if (container) { // Check based on the scrolling container const containerRect = container.getBoundingClientRect(); return rect.top >= containerRect.top && rect.bottom <= containerRect.bottom; } else { // Check based on the browser window return rect.top >= 0 && rect.bottom <= window.innerHeight; } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/systeminit/si'

If you have feedback or need assistance with the MCP directory API, please join our Discord server