Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.5a is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthormversion
    • CommentTimeFeb 4th 2007
     permalink
    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.

    thanks.
    •  
      CommentAuthorJohnRiv
    • CommentTimeFeb 5th 2007 edited
     permalink
    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:

    HTML:

    <div class="lightboxImage" style="background-image:url('IMAGEURL');">
    <a href="PERMALINKTOPREVIOUSPHOTO"></a>
    <a href="IMAGEURL" rel="lightbox" class="lightboxLink" title="Lightbox Image Caption"></a>
    <a href="PERMALINKTONEXTPHOTO"></a>
    </div>

    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.
    • CommentAuthormversion
    • CommentTimeFeb 5th 2007
     permalink
    Actually they are going to be the same size so i'm happy that is making things easier. i will try this very soon and report.

    thanks a lot john.
    • CommentAuthormversion
    • CommentTimeFeb 8th 2007
     permalink
    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?

    Thanks for the help so far John.
  1.  permalink
    What about just adding another class to the vertical pictures? Perhaps the code that John used, but adding a horizontal and vertical aspect to it...


    .lightboxImageH {
    width: 500px; // or whatever the standard image width is
    height: 333px; // or whatever the standard image height is
    }

    .lightboxImageV {
    width: 333px; // or whatever the standard image width is
    height: 500px; // or whatever the standard image height is
    }

    .lightboxImageH a {
    display: block;
    width: 33%;
    height: 333px; // or whatever the standard image height is
    float: left;
    }

    .lightboxImageV a {
    display: block;
    width: 33%;
    height: 500px; // or whatever the standard image height is
    float: left;
    }

    .lightboxImageV a.lightboxLink,
    .lightboxImageH a.lightboxLink {
    width: 34%;
    }
    • CommentAuthormversion
    • CommentTimeFeb 9th 2007
     permalink
    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.
  2.  permalink
    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...
    •  
      CommentAuthorJohnRiv
    • CommentTimeFeb 9th 2007
     permalink
    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.
    • CommentAuthormversion
    • CommentTimeFeb 10th 2007
     permalink
    hey guys,

    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.
Add your comments
    Username Password
  • Format comments as (Help)