javascript - how to make iframe open in new window -
i have problem iframe flickr.
i have website in embed iframe flickr in order display gallery without having worry creating slider , resizing pictures , extracting thumbnails.
also since website friend of mine wants able change pictures on own without having ask me time change website.
so solution use iframe flickr created galleries , embeded galleries website.
this code:
<div class="six columns"> <iframe src="https://www.flickr.com/photos/127583121@n07/15148138666/in/set-72157647343739461/player/" width="500" height="281" frameborder="0" allowfullscreen webkitallowfullscreen mozallowfullscreen oallowfullscreen msallowfullscreen></iframe> </div>
my problem when viewer clicks on image redirected flickr website therefore gone site.
is possible make when user clicks on iframe open flickr website in new browser window user not lost site?
thank in advance
try this:
<div class="six columns"> <iframe name="myframe"></iframe> </div> $(document).ready(function () { window.open("https://www.flickr.com/photos/127583121@n07/15148138666/in/set-72157647343739461/player/", "theframe"); });
it open new pop-up window , user can interact separately images in that.
updated solution
after lot of search , tries, made solution close want. require click
confirm user. if user clicks stay on page
iframe opened in window.
$(document).ready(function () { window.onbeforeunload = function () { window.open("https://www.flickr.com/photos/127583121@n07/15148138666/in/set-72157647343739461/player/", "theframe"); return ""; } }); <div id="dv" class="six columns"> <iframe id="myframe" name="myframe" src="https://www.flickr.com/photos/127583121@n07/15148138666/in/set-72157647343739461/player/"></iframe> </div>
Comments
Post a Comment