GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Iframe open in new tab (https://gfy.com/showthread.php?t=1309615)

Cameltoepro 02-22-2019 02:29 PM

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?

roxpoxy 02-22-2019 03:08 PM

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

sarettah 02-22-2019 04:37 PM

Quote:

Originally Posted by Cameltoepro (Post 22420693)
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?

Put a div with an anchor tag over the iframe.

<a href=urlyouwanttoopen target=_blank>
<div>
<iframe>
</iframe>
</div>
</a>

Be aware that opening in a new tab can trigger popup blockers.

.

Cameltoepro 02-22-2019 04:43 PM

Thats true..im going to try all of them

acason 02-24-2019 07:42 AM

Get with file get contents.

Cameltoepro 02-24-2019 07:58 AM

Yeah..nothing works right..so just went with banners

sarettah 02-24-2019 10:37 AM

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.

.

sarettah 02-24-2019 10:57 AM

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.

.

Cameltoepro 02-24-2019 12:30 PM

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