'How to position window.parent scrollbar to the selected element position
Hi Using iframe I'm calling my angular project inside the ColdFusion Project. Im displaying the table in angular when I'm selecting any TR I will open a div over the table. at that time I can able to scroll outer scroll which is in coldFusion side. my requirement is when I close the div I want to go back to the position of outer scroll to the position of TR where I clicked.
positioningAccordian(id: any): void {
setTimeout(() => {
const element = document.getElementById(id);
element ? window.parent.scrollTo(0, element.offsetTop) : null;
});
}
The parameter id is the id of TR. My requirement is to restore the position of parent scroll to its position where it was before opening a div.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
