Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
02-22-2019, 02:29 PM | #1 |
Confirmed User
Industry Role:
Join Date: Sep 2012
Posts: 1,431
|
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?
__________________
Awesome Hosting At Awesome Pricing At Vacares |
02-22-2019, 03:08 PM | #2 |
Registered User
Industry Role:
Join Date: Jan 2015
Posts: 87
|
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
__________________
|
02-22-2019, 04:37 PM | #3 | |
l8r
Industry Role:
Join Date: Oct 2002
Posts: 13,513
|
Quote:
<a href=urlyouwanttoopen target=_blank> <div> <iframe> </iframe> </div> </a> Be aware that opening in a new tab can trigger popup blockers. . |
|
02-24-2019, 07:42 AM | #5 |
Confirmed User
Industry Role:
Join Date: Jan 2019
Posts: 126
|
Get with file get contents.
__________________
|
02-24-2019, 10:37 AM | #7 |
l8r
Industry Role:
Join Date: Oct 2002
Posts: 13,513
|
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. . |
02-24-2019, 10:57 AM | #8 |
l8r
Industry Role:
Join Date: Oct 2002
Posts: 13,513
|
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. . |