If the iframe page does not have a scroll bar and a scroll bar appears in the parent form, the anchor mark will become invalid. js is used to determine whether the page is nested. The Application Scenario of calculating iframe in the parent form using js is: the iframe page does not have a scroll bar. If a scroll bar is displayed in the parent form, the anchor mark will become invalid because the anchor will scroll through the window based on the current window scroll bar and no scroll bar will appear after it becomes a child form, naturally, it does not scroll.
Solution: Use js to determine whether the page is nested. Use js to calculate the position of iframe in the parent form and the position of the anchor in the firame. The two are added as the scrolling of the parent form.
Problem: Get the parent form element (because of domain restrictions, all needs in the network environment (that is, http://domain.com); parent form nested multiple iframe to determine whether it is the current iframe page.
Code:
Parent form page index.html
ddddd
Window page iframe.html