Jump to content

Css Lightbox Alternative?


Kingy

Recommended Posts

Hey everyone it's been a while. >_>I'm in the middle of designing my personal portfolio site, for my images section I'd like to have something like Lightbox where I click on an image and it 'pops up' in the same window, then goes away when I click again.Ideally I'd rather have something simple and lightweight with just CSS and JavaScript, as opposed to having a JS library lying around. Free's the best price after all, does anyone have any suggestions?

Link to comment
Share on other sites

Have a button or link or something with an onclick handler. The handler gets some value from the link, like maybe an href, and then uses that for the src of an image in your display area.It's usually best to have a dedicated display area laid out from the beginning, rather than have one "pop" into existence. Some designers put a neutral image there at page load just to hold the space and let users know that images will appear there when they click on your widget.A link is the best trigger for a thing like this, since the href property is good for storing image addresses, and also because it will function as an actual link to your image for those few users who don't enable javascript.

Link to comment
Share on other sites

I was thinking of having a designated area initially, and I just wondered if it would be 'flashier' to have it pop into existance. Loading images into a div will be a piece of cake in the designated area kind of format. Did you suggest that because users prefer this kind of layout?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...