Lightbox

smalpierre

New member
Ok, so I'm looking for a good lightbox library, and so far I haven't found exactly what I want yet - maybe you guys have some ideas?

Here are my requirements:

1. I'm trying to completely eliminate jQuery and it's ilk. I'm not going to run jQuery just for a lightbox - libraries that run on other libraries. So its got to be plane old vanilla javascript.

2. It has to handle forms (contact, login, etc) photo galleries, videos, pdf documents, and maybe some other things.

3. Some things in iframes are ok to an extent, but I don't want everything in them. Youtube is one thing, but content from my site - like forms and photo galleries should be in divs. I'm going to be ajax loading content...

4. Not 100% necessary, but I would REALLY LIKE it to be able to handle callbacks - so I can make a function call at times like beforeload, afterload, beforeclose, afterclose ... that would be REALLY nice. Also I would like the callbacks to be able to be called with parameters.

5. bonus features: modeless dialogs, tooltips, and a documented javascript API so I don't have to use tags to specify the dialog and it's options.

My first choice was Floatbox http://www.floatboxjs.com

My problem is that I couldn't come to an agreement with licensing. At $20 / site, and subdomains count as separate sites - the first project would be $200, the next would be about $600 - Im not paying that much. He will sell me bulk licenses for a discount, but then if one location goes away, and another one comes up - it's another license - so it's a huge headache dealing with that. For the $1000 it'd cost me within the first year or so, I'll build my own damn lightbox!

My second choice - that I'm using right now, but its not ideal is Lytebox http://lytebox.com

My problem with that one, is that 1. it's got callbacks, but you can't pass parameters - if you want to call myFunction() - you pass a value of "myFunction" and it runs it - I tried it with parenthesis and parameters, and it didn't work. Then it loads EVERYTHING as an iframe. There's ways around the problems this creates, but I don't want workarounds to be standard practice on my sites. A one-off is one thing, but core functionality is something entirely different.
 
Everything you describe sounds like simple PHP with functions. You could even include coopermine. Or I could give you my gallery files that I have. Sure its not a simple plug and play or drag and drop.
 

smalpierre

New member
No, this is client side stuff - displaying the lightbox in the browser - it can be done with vanilla javascript and CSS, but I'd rather not right now. The ajax calls yes will hit a php script for server side processing, That I've got under control - it's the front end bits that I need.

I'll send you a link when I get something worth showing you ...

I'm trying out another one called Highslide right now. I think it might fit the bill - lytebox is ok, but the iframes I'm not liking, and the callbacks not being able to have parameters passed isn't too cool either.
 
smalpierre said:
No, this is client side stuff - displaying the lightbox in the browser - it can be done with vanilla javascript and CSS, but I'd rather not right now. The ajax calls yes will hit a php script for server side processing, That I've got under control - it's the front end bits that I need.

I'll send you a link when I get something worth showing you ...

I'm trying out another one called Highslide right now. I think it might fit the bill - lytebox is ok, but the iframes I'm not liking, and the callbacks not being able to have parameters passed isn't too cool either.

Again, all stuff that can be done with PHP on the client side. There is code to embed pdf and videos. I don't get why you want to reinvent the wheel or use someone elses cut and paste code. Maybe I am old fashion and believe is doing things myself. Or I just find those types of programs complex and filled with security issues.
 

smalpierre

New member
Php is server side. It doesn't do what Im looking for. It's a UI element I'm needing. It will however handle the server side processing for ajax form submits and validation.

I could build it myself, but as much work as it would involve I'd rather not reinvent that wheel right now. I probably will eventually roll my own, but I've got way too much to do already.


Embedding isn't what I want, if that was all I needed html5 has tags for that, and JavaScript players abound. As for client side php, I've never encountered a browser that had a built in php interpreter ...

What Im wanting is a lightbox - its basically modal JavaScript dialogs, with some CSS to darken around it. The modal will be interacting asynchronously with the server - calling php scripts to interact with the database ... But that's not all I'm going to use it for, I might use it for photo galleries, video players, maps, calendars ...

Anyway, I think highslide does what I want for the most part. If it works really well I'll buy the unlimited license for $170. If it saves me a day its making me money.
 
smalpierre said:
Php is server side. It doesn't do what Im looking for. It's a UI element I'm needing. It will however handle the server side processing for ajax form submits and validation.

I could build it myself, but as much work as it would involve I'd rather not reinvent that wheel right now. I probably will eventually roll my own, but I've got way too much to do already.


Embedding isn't what I want, if that was all I needed html5 has tags for that, and JavaScript players abound. As for client side php, I've never encountered a browser that had a built in php interpreter ...

What Im wanting is a lightbox - its basically modal JavaScript dialogs, with some CSS to darken around it. The modal will be interacting asynchronously with the server - calling php scripts to interact with the database ... But that's not all I'm going to use it for, I might use it for photo galleries, video players, maps, calendars ...

Anyway, I think highslide does what I want for the most part. If it works really well I'll buy the unlimited license for $170. If it saves me a day its making me money.




Yes, server side, that is what PHP scripting is. But, you can do everything you want or describe with it. The stuff you are looking at is just doing what you want without you writing the code. Yes, its time consuming at times, but you can also find examples of the code you want and alter to your liking to help save time or just pay someone else to do the work. Basically that is what you are doing when you buy a license. I just like to make things from scratch or alter others work to fit my needs. But, if you are involving Ajax, then you are getting into Java any ways. So was just giving options without Ajax or Ajax calls.
 

smalpierre

New member
Ajax is JavaScript not java. Totally different animals. Sure I can create a login or contact form in php, and not even use JavaScript, but what I want is for a user to not be redirected or otherwise lose where they are in the site, and for info on the page to update without a page refresh. So when they log in successfully, it can change the login/register link to a welcome #username# logout link.

This is a bare bones example, I'm going to have a lot of dynamic content and modal / modeless dialogs.


For $200, its not worth my time right now. I don't care for coding UI elements much anyway.
 
smalpierre said:
Ajax is JavaScript not java. Totally different animals. Sure I can create a login or contact form in php, and not even use JavaScript, but what I want is for a user to not be redirected or otherwise lose where they are in the site, and for info on the page to update without a page refresh. So when they log in successfully, it can change the login/register link to a welcome #username# logout link.

This is a bare bones example, I'm going to have a lot of dynamic content and modal / modeless dialogs.


For $200, its not worth my time right now. I don't care for coding UI elements much anyway.



Again, all stuff you can do with PHP. You can login and still be on the page you were on. That can be done with CSS.

Here is the code to do it
Code:
$refering_url = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '' ;

$this->session->set_userdata('url', $refering_url);

$url=$this->session->userdata('url');

redirect($url, 'refresh');

I think the welcome message would show up like it does now without adding anything else or maybe add some code for the sessions too.

Not saying this is correct or what you are considering, Not sure what you wanted with youtubes vids, but I think you can add code that will hot link the vids to your site. You have me on the PDF files. But that may be a few lines of code that will get the browser to open the file in PDF format. I could take you a few days to do it, and maybe even reduce server loads and files. That is if you just alter the code you have now.

This is for the PDF

Code:
<?php

echo "<iframe src=\"file.pdf\" width=\"100%\" style=\"height:100%\"></iframe>";

?>

<object data="abc.pdf" type="application/pdf">
    <embed src="abc.pdf" type="application/pdf" />
</object>

Add some embed and object for HTML5 and object for older browsers
 

smalpierre

New member
I'm aware of how to embed things in a page, that's not what I'm doing. That php basically will just redirect you to the previous page at the end of a script. Thats how I used to do it, but its not what I'm going for.

Oh, in the iframe you can omit the php, there is no reason to echo unless you're inserting variables. It only cost server resources.

Here is a demo of some of the UI elements I want to implement:
http://floatboxjs.com/demo


Thats the guy I couldn't come to licensing terms with. It's the best I've found, even though I'm not sure if it supports callbacks.

Then I was looking at lytebox.com, but its callbacks dont support parameters, and the lighthouse are all iframes. I need to be able to manipulate the base page easily

Then I got to highslide.com and It looks like it does most of what I want. It's examples are sparse, it does a lot more. I'm doing testing tomorrow to find out if its got shortcomings I can't deal with.

If its not plain JavaScript, its not even considered. I'm not going to use jquery at all. It does have to work well on mobile - droid / ios, and ios 11+, chrome, Firefox, and Mac safari. I'm not supporting old crusty ie browsers ...
 

smalpierre

New member
@"strokerace" I do agree that it's better to code your own stuff, then you know it inside and out, you can build it exactly how you want, no licensing issues or bloat. Eventually I'll probably roll my own.

I'm trying to eliminate dependencies for sure. jQuery is my top priority. The responssive navigation uses it. I hate sending a whole library down the wire over a couple of lines used to trigger an off canvas.

Slim is the next thing to go. Im only using it as a front controller. I've got to code every route in a file, I want to do it in the database. Instead of coding routes in index.php and calling slim, it will BE the front controller, and call the database for routes.

Then I'll focus on small vendor scripts - and this is the only one.

I'm on a time schedule, and don't have time to do all this before roll out so I'm sucking it up for now. At that point added functionality will be all mine, one at a time.