d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > 500fg For Jquery / Js Code
Add Reply New Topic New Poll
Member
Posts: 1,358
Joined: Dec 30 2012
Gold: 0.10
Feb 11 2014 01:01am
Im terrible with jquery / javascript and don't have time to learn atm.

Basically, there are multiple external links listed on a page.. What I need is jquery / javascript code that will open up the link as an iframe popup (sorta like lightbox) when clicked.

Here is my code that it needs to work with.

Code
<div class="container">
<table id="s" class="links">
<tbody>
<tr><td id="site"><a href="http://foobar.com/" name="link">Foobar link 1</a></td></tr>
<tr><td id="site"><a href="http://foobar.com/" name="link">Foobar link 2</a></td></tr>
<tr><td id="site"><a href="http://foobar.com/" name="link">Foobar link 3</a></td></tr>
<tr><td id="site"><a href="http://foobar.com/" name="link">Foobar link 4</a></td></tr>
<tr><td id="site"><a href="http://foobar.com/" name="link">Foobar link 5</a></td></tr>
</tbody>
</table>
</div>


This post was edited by SelfTaught on Feb 11 2014 01:03am
Member
Posts: 29,723
Joined: Jun 11 2007
Gold: 279.52
Feb 11 2014 09:04pm
look into something called pretty box
Member
Posts: 1,995
Joined: Jun 28 2006
Gold: 7.41
Feb 11 2014 10:22pm
I might be offbase here, but couldn't you do something along the lines of

Code
<script laguage='javascript'>
function openInIFrame(url)
{
document.getElementByID('inset_iframe_id_here').src = url;
}
</script>


And then

Code
<tr><td id="site"><a href=javascript.openInIFrame('http://foobar.com/') name="link">Foobar link 1</a></td></tr>
Member
Posts: 2,217
Joined: Sep 10 2007
Gold: 35.88
Feb 12 2014 10:30am
I highly recommend Colorbox for this. A quick google search for colorbox will get you there.
Check the examples, there is one linked as "Outside website" which is what you want.
It looks and works great, and is also easy to implement
All you have to do is add the correct class to your links.
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll