Nathan Pitmanhello, my name is
nathan pitman.

Adding on hover copyright to Lightbox Feb 13. 062

I’ve been using Lightbox by Lokesh Dakar on a current project and needed to add a simple copyright message on hover just to remind those nice users that they really shouldn’t simply rip my client off by printing little snap shots directly from his website.

Obviosuly this won’t deter the determined, it’s by no means bulletproof, but perhaps will serve as a gentle reminder to others.

#lightbox {
 background-imageurl(/assets/copyright.gif);
 
background-positioncenter;
 
background-repeatno-repeat;
}

#lightbox a:hover img#lightboxImage {
 filter:alpha(opacity=50);   
 -
moz-opacity0.50;   
 
opacity0.50;
}

At first I was looking for an easy way to script the overlay of a PNG with a copyright text but in the end I just went with a nice little opacity effect on the photo in question, thus revealing a copyright message which had been set as the containing DIV background image. Keep it simple stupid.

Of course, if you know of a better method, let me know. :)

Tagged: Code

To do that I’d have to pass the image dimensions to the blank image somehow… not being a javascript guru I’m not sure how that’d work, hence my CSS based approach! :)

Posted by Nathan Pitman  on  02/13  at  10:38 PM

Speak your mind

Name:

Email:

Location:

URL:

Remember my personal information

Notify me of follow-up comments?

Submit the word you see below: