0

I created a website with a lot of news articles from different websites. What I have now is that if you click on a news item then it will open a new window to that original site (target="_blank").

What I want is that it opens a 'virtual' screen on the same browser tab (or window) with some button "X" on the corner. So when the user clicks "X" that 'virtual' screen closes and my site (what is underneath) is showed so you can scroll further on my site. So what I definitely don't want is that the link opens in the same window.

Looks like reddit.com has some variant of it. If you scroll a few pages down and you click on a post then the post shows almost full screen as some kind of an embedded window. When you click the "X Close" button you are back to where you was with the scrolling on the main page.

So I want this but with an external site as embedded window. Is this possible? Do i need so kind of a javascript library? Any help is welcome as I could not find the correct keywords (I guess" on google.

Geveze
  • 393
  • 3
  • 12
  • Is this more or less what you're thinking? https://stackoverflow.com/questions/25565716/load-iframe-in-bootstrap-modal – Mech Feb 09 '20 at 18:58
  • I think the new Reddit is done using React and you could go that way. Or you could use an iFrame inside a modal if you wanna use native JS, CSS and HTML. – Gaurav Punjabi Feb 09 '20 at 19:07
  • You might want to note that "`with an external site as embedded window`" will likely cause you to run into cross-origin scripting restrictions enforced by browsers. If you control the server that provides the "embedded" content, you can set CORS headers to allow access from the other origin for your HTTP requests. (See more at https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) – Cat Feb 09 '20 at 19:30

0 Answers0