rlightbox2 icon indicating copy to clipboard operation
rlightbox2 copied to clipboard

Load HTML content from URL?

Open mishal opened this issue 13 years ago • 5 comments

I would like to have in rlightbox something like I use with fancybox.

$.fancybox(url, { type: 'iframe'});

This issue is related with #2

mishal avatar Nov 04 '11 11:11 mishal

Hi Ryrych,

First, let me congratulate you for this very good job... I'm using rlightbox with rcarousel, and both of them rocks !

I needed this feature too, so I created a patch to load an iframe with rlightbox. You can find the diff (with v1.1) here : http://pastebin.com/tk3iDPnr

Usage :

<a class="lb" href="http://www.example.com/index.php?width=800&height=600" title="Load an iframe with rlightbox">Load an iframe with rlightbox</a>
<a class="lb" href="http://www.example.com/index.php" title="Load an iframe with rlightbox (default width)">Load an iframe with rlightbox (default width)</a>

It simply detects ".php" or ".html" extensions in the URL, because it is sufficient for the use I make of it right now, but maybe this part should be deepened, if you want it to be more modular, it's up to you...

Kind regards

fpoy avatar Feb 02 '12 14:02 fpoy

Hey bro! It is strange because I saw your patch (I have google alerts set up) but I must have overlooked your comment. Because I’m going to work on a next feature release in a couple of days, it is a perfect time to include your patch. Thanks a lot!

Could you shown ma a real life example? :)

ryrych avatar Feb 04 '12 19:02 ryrych

Of course, for a real life example, you can check it at http://www.tourisme64.com/test/resto/restaurants.html I'm currently working on it. The google map icon on the right side is opening an iframe with patched rlightbox.

fpoy avatar Feb 06 '12 08:02 fpoy

Hi Ryrych, thanks for all your hard work! Love this plugin.

Fpoy love the work you've done on the iframe add as i'd also like to add a content box with normal text (like a lightbox) but just displaying basic info in a div etc. I saw your live working Gmap examples.

I used your commented in code for the iframe you showed in PasteBin but still can't get mine to work. I don't have any errors and I don't see the changes added into the Version 1.1.1 of RLightbox2 - Could you please send me the jquery.ui.rlightbox.js file with your added code in it?

Then last question when it comes to the class, shouldn't "lb lb_iframe" be used instead of the plain "lb" if i'm using "lb lb_galleryset1" and "lb lb_youtube" already?

Thanks!

Marcelive avatar Jul 05 '12 09:07 Marcelive

Hi Marcelive,

You will find the updated jquery.ui.rlightbox.js file here : http://pastebin.com/s6NgPjws

If you want to group your elements to make a set, you can use class="lb lb_iframe" if you want... You will then be able to target them with : $(".lb_iframe").rlightbox(); or all the lightboxes with : $(".lb").rlightbox(); It depends on what you expect...

fpoy avatar Aug 20 '12 14:08 fpoy