Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

zblaxberg

Guest
Original poster
Jan 22, 2007
873
0
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?
 
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
 
Do you have to pay to incorporate Lightbox into your site? If so how much and is it worth it?

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
 
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.
 
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?:)

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.
 
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.
 
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,
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:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.