Anyone ever used lightbox2?

Discussion in 'Web Design and Development' started by zblaxberg, Aug 12, 2009.

  1. zblaxberg Guest

    zblaxberg

    Joined:
    Jan 22, 2007
    #1
    I'm trying to incorporate it into my website and I have a problem where the lightbox keeps displaying at the bottom of the page. Anyone know how to move it up to be 'superimposed' over top of my website rather than displaying below it?
     
  2. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #2
    In most lightbox2 methods there is a div associated with the overall effect. In your CSS, use absolute positioning to place the div where you want it, based on its height and width.

    If the div ID were "gallery", the CSS could be (example only):

    div#gallery {

    position: absolute;
    top: 10px;
    left: 20px;
    height: 200px;
    width: 200px;
    z-index: 1; /* must be larger than any other z-index set elsewhere */
    }

    Set it 10px down from the top of the page and 20px across from the left, 200 pixels square, on top of any other content. You play with the numbers or use CSS techniques like this for centering top/bottom on the page.

    If there is no div assigned to the lightshow2 object, wrap a <div id="gallery"></div> around it, simple as that.

    Then you can make the object transparent using lightbox2 fade methods. Consult documentation for that.

    -jim
     
  3. Dal123 macrumors 6502a

    Dal123

    Joined:
    Oct 23, 2008
    Location:
    England
    #3
    Do you have to pay to incorporate Lightbox into your site? If so how much and is it worth it?
     
  4. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #4
    It's free and open source with a Creative Commons Attribution 2.5 License, the only requirements for Lightbox2 are the Prototype framework and Script.aculo.us effects library which extend it and both are free as well.

    Details here - google "scriptaculous" and "prototype framework" for the others

    -jim
     
  5. Dal123 macrumors 6502a

    Dal123

    Joined:
    Oct 23, 2008
    Location:
    England
    #5
    Cheers Jim, but why would they spend loads and loads of time writing this script only to dish it out for free :confused:. Very good of them I know but how do they make their money?:)
    I have seen another type too, pretty sure it was lightbox but this one displayed the photo's in a normal sequence of little squares, when you clicked on the photo to view it. It enlarges towards the screen, then when you cross it off (close it) it zooms back to it's original size. Really in a class of it's own. Came from the square you clicked on so it's easy to navigate and the person knows they are viewing it; as opposed to one I just looked at where the navigation (small photo's were at the top) and the larger image was below it. At first I thought it didn't work, nearly navigated away from the page. Imagine if I was a normal person not particularly interested and stumbled across my site, I would've lost them.
     
  6. angelwatt Moderator emeritus

    angelwatt

    Joined:
    Aug 16, 2005
    Location:
    USA
    #6
    Some of their code is likely based off someone elses (isn't all code:)), which would keep them from being able to charge for it. Also, JavaScript is hard to protect since visitors can view the source code directly, and trying to take someone to court over stealing the code just ends up wasting money. I've never seen any JavaScript worth paying for, but then again I'm a developer so I can make what I need.

    I've seen the other implementation you mentioned (well there's a couple that fit that). It can be very helpful for users as you experienced.
     
  7. SrWebDeveloper macrumors 68000

    SrWebDeveloper

    Joined:
    Dec 7, 2007
    Location:
    Alexandria, VA, USA
    #7
    All that is the benefit of open source, and the concept is if you can't find what you need, find something close and customize it, or study the code and learn how to make your own as angelwatt noted. Then, if possible, share it, later, and continue the cycle. The objectives of open source include a reduction in development time, reduced costs in the overall project, avoiding reinventing the wheel, introducing more features more easily and quickly to projects, rapid time-to-fix, code sharing, improvement by committee and so on. By no means the only or best solution, the one thing that is true is open source is well respected and common these days for many small and large scale projects as it's much more mainstream and organized (i.e. sourceforge.net, frameworks) than it was in the past.
     
  8. Dal123 macrumors 6502a

    Dal123

    Joined:
    Oct 23, 2008
    Location:
    England
    #8
  9. Dal123 macrumors 6502a

    Dal123

    Joined:
    Oct 23, 2008
    Location:
    England
    #9
    If you check-out that link; see how many different varities there are:eek:. Imagine if I was to clever enough to customise a code :p then published my slideshow on my site. Yet a few months later someone would think I copied their work as it was ever so similar to theirs. There are so many different types it's unbelievable:confused:. Don't want to pay for someone else's, but don't want to go to court.:confused:
     

Share This Page