7 lines
227 B
TypeScript
7 lines
227 B
TypeScript
export function handleSmoothScrollToTitle(targetId: string): void {
|
|
const targetElement = document.querySelector(`#${targetId}`);
|
|
if (!targetElement) return;
|
|
|
|
targetElement.scrollIntoView({ behavior: 'smooth' });
|
|
}
|