Iframe open in new tab
Have a question. I have gooled this to death. Yet, nothing I have found works right. I'm using a Iframe on a blog. The Iframe works great. Yet, I'm wanting to make so when the suffer clicks on the Iframe it opens in a different tab. Here is my current code: [iframe src="https://imlive.com/wmaster2.ashx?wid=xxxxxxxx&LinkID=701&promocode=BC ODEL0000002_00000&QueryID=1&from=freevideo6"]
Is this workable? |
may be a bit tricky, I would try to break out of the frame with a bit of javascript then re-directing.
something like these: https://css-tricks.com/snippets/java...out-of-iframe/ https://stackoverflow.com/questions/...-parent-window |
Quote:
<a href=urlyouwanttoopen target=_blank> <div> <iframe> </iframe> </div> </a> Be aware that opening in a new tab can trigger popup blockers. . |
Thats true..im going to try all of them
|
Get with file get contents.
|
Yeah..nothing works right..so just went with banners
|
Ok, I screwed up what I put up. I hate when I do that :(
You don't need a div wrapping around the iframe, you need a div overlaying the iframe. Anyway, I put a demo page up for you at Cameltoepro's Iframe test When you click anywhere on the iframe it opens a new tab/window for the same url as the iframe. You can, of course make the url anything you want. I used absolute positioning to put the overlay directly over the iframe. You could do a div that overlays the entire page and you would not have to do the positioning on the iframe but then any click on the page would go to the url. The code in there for the pertinent section is: <!-- destination url --> <a target=_blank href=https://imlive.com/hostlist.ashx?cat=1&Roomid=10,160&fromsearch=detai l&gallery=1&captionid=1> <iframe style="position:absolute;top:50px;left:50px;width: 500px;height:500px;" src=https://imlive.com/hostlist.ashx?cat=1&Roomid=10,160&fromsearch=detai l&gallery=1&captionid=1 scrolling=no></iframe> <!-- This div overlays the iframe --> <div style="position:absolute;top:50px;left:50px;width: 500px;height:500px;"></div> </a> Tested in Chrome, FF and Opera. . |
The anchor tag in there does not have to come before the iframe. It can be coded after the iframe if that code makes more sense when you look at it.
<iframe style="position:absolute;top:50px;left:50px;width: 500px;height:500px;" src=https://imlive.com/hostlist.ashx?cat=1&Roomid=10,160&fromsearch=detai l&gallery=1&captionid=1 scrolling=no></iframe> <!-- destination url --> <a target=_blank href=https://imlive.com/hostlist.ashx?cat=1&Roomid=10,160&fromsearch=detai l&gallery=1&captionid=1> <!-- This div overlays the iframe --> <div style="position:absolute;top:50px;left:50px;width: 500px;height:500px;"></div> </a> That works the same as the other code I believe. Anyway, I hope that helps with the situation. . |
Damn. Thanks..I like the way it looks..I will let you know how it works..😀
|
All times are GMT -7. The time now is 10:02 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc