简体   繁体   中英

Iframe not loading iframe internal links at the top of the iframe/parent page

I have a webpage (called PageA) that has a header and a main navigation bar and then simply includes an iframe. Lets call the page within the iframe PageB. PageB simply has a list of products but there are a lot of products so you have to scroll down on PageA to view them all.

When I scroll down PageA to see the bottom of pageB and click on a product link it looks like it takes me to a blank page. What actually happens is that it brings up the product image and description but since the page that just has one product and its description is much shorter in height, the scroll bar stays at the same location and doesn't adjust for it. I have to scroll up to the top of the page to view the product, description and to see the add to cart button.

Is there anyway when I click a link on a page that is within an iframe, the outer pages scroll bar goes back up to the top?

<iframe src="shop.undergloled.com";; onload="window.scroll(0,0)"; width="980" height="1400" frameborder="0" style="display:block seamless;"> </iframe>

尝试这个

<iframe src="http://shop.undergloled.com" onload="window.scroll(0,0)" width="980" height="1400" frameborder="0" style="display:block;"></iframe>

试试吧

<iframe src="http://shop.undergloled.com" onload="window.scroll(0,0)" width="980" height="1400" frameborder="0" style="display:table !important;"></iframe>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM