Hi guys, i am trying to accomplish something with the help of lightbox.
i am creating a daily photo blog using movabletype. there will be one main image every day. i want the users to be able to browse their way around using overlays on that days photo.
for example, if they hover over to the left of the image, i want to be taken to the previous day, if they hover over the center, i want the large image to be pop up (the lightbox way of course) and finally if they move their mouse over to the right, i want to be taken to the next day. here's an example of what i am looking for:
can this be done?
anyone who can help me will be fully credited on the about page.
I assume you want the actions to occur when they click on parts of the image instead of when they mouseover. If all of your images are the same size, then it's real easy:
replace all the items in ALL CAPS with the actual value.
CSS:
.lightboxImage { width: 500px; // or whatever the standard image width is height: 333px; // or whatever the standard image height is } .lightboxImage a { display: block; width: 33%; height: 333px; // or whatever the standard image height is float: left; } .lightboxImage a.lightboxLink { width: 34%; }
You may want to add a .lightboxImage a:hover style as well and display a background image so the user knows what their click will do.
If your images aren't going to be the same size, then we'll need to get a little more creative to make it work.
It works just perfect. I will put up a test site up soon. However i forgot about one vital thing... all my images are 500px wide, and 333px high. This will be the case with most of the images, however i forgot about the vertical images.
Any ideas? How complicated is it to have it work with different image sizes?
the way i have it setup is that i just upload the picture, and it works just fine. i don't have to type any code, i just have movabletype insert the file name into the template and everything is good to go.
I am trying to have this as fool proof as possible as this will be a multi-user photolog. the way it works right now is, upload picture, write the image name in the mt excerpt field. write a blurb about the photo and hit publish.
some of the users would have no idea how to write up a class definition.
obviously your way will be the way to go if there's no alternative. but i was hoping for an automated solution. i don't know, an auto height, width solution. thanks though wafflestomper.
I don't think there is an automatic way short of writing some php code...
I don't use MT, so I won't be much help, but is there a way to add a drop down menu that would allow the user to select the layout of the image? Portrait or Landscape? You could then write a little code to add a class depending on what they chose as the layout... Again, I don't know how much flexability MT offers, so this may not even be an option...
i agree with wafflestomper that the best way to handle it is with custom css classes assigned to the DIV depending on if the image's orientation is vertical or horizontal, and you can determine that with PHP's getimagesize function. You can do the same with JavaScript, but I'd go the server-side route in case any users have JavaScript disabled.
Another option is you could set up "vertical image" and "horizontal image" categories in MT, and then use MTEntryCategories to determine which category they selected. If a user forgets to set a category (or if they pick both for some crazy reason), then you can just default to horizontal. You could also add some JavaScript to the Entry Edit page to be sure they select either the "vertical image" or "horizontal image" category before they can submit the form.
getimagesize has fixed all my problems. a very early draft is posted here. i have spent all this time on setting up the navigation. now on to designing the layout. http://mversion.com/daily/index_.php
the only issue remaining is the very first entry, the zoom and next entry overlays aren't in place. but i suppose i can live with that as it will only be the very first entry.
anyway, thank you very much for the help and guidance. couldn't have done it without you guys.