Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
373 views
in Technique[技术] by (71.8m points)

javascript - 滚动父窗口时,iframe中出现粘滞div(Sticky div inside iframe while scrolling parent window)

I have a webpage with a large iframe overflowing the height of the page.

(我有一个网页,其中的大型iframe溢出了页面的高度。)

I have a sticky div/header inside the iframe.

(我在iframe中有一个粘滞的div / header。)

I would like for the header to "act sticky" when the parent window is being scrolled, is there a way to achieve that?

(我想在滚动父窗口时使标题“发粘”,有没有办法实现?)

Can I somehow force the parent's view port onto the iframe?

(我可以以某种方式将父级的视口强制插入iframe吗?)

Note that I can access the parent window from the iframe if needed (same origin).

(请注意,如果需要(相同的来源),我可以从iframe访问父窗口。)

Thank you for any tips!

(谢谢您的提示!)

  ask by roast translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...