Hi, can anyone suggest a script or let me know what sort of code should be used to achieve the same effect as this demo?
I do know how to use opacity in CSS to make an image darker or lighter on mouseover, but this looks like it’s using javascript and it looks much slicker. I’d really like to have darkened images that light up on mouseover, but with that fade effect instead of just instantly changing like the opacity setting does. Any sugestions? Thanks!
The important parts are the CSS inside the <head> section of the document, as well as the JavaScript include (MooTools library) and the JavaScript before the closing body tag (responsible for the fade in / out effect).
You could also achieve such an effect using jQuery, something like this:
First of all, thanks so much for the detailed response! Now…for the code itself, I tried out the jquery code you gave and it works perfectly! Unfortunately, now the gallery thumbnails, when clicked, are jumping straight to filename.jpg instead of popping up in the lightbox format. I’m assuming that’s because of some conflict with the js code, but I’m not experienced enough with javascript to figure out exactly what.
You are absolutely amazing. Everything is working perfectly now. I can’t thank you enough for your help with this! The lightbox looks beautiful and the thumbnails are exactly as I wanted them to be. I have just one last question and then I promise I’m done…is there an easy way to hide/remove the image counter? I like that the title shows when the lightbox pops up but I was hoping to remove the “Image # of #” line. Any quick fixes for that? If not, never mind, it’s not that important. I really appreciate all of your help with getting this set up.
The only way to remove the “Image # of #” line (that I am aware of), is to hack the plugin code.
It would be possible to just comment out the lines responsible, but that seemed a little hacky.
Therefore, I modified things a little, so that if you set the following global variable in your JavaScript code, before lightbox.js is included, the offending line will not display:
var hideImageCount = true;
If you do not set the variable, then the “Image # of #” will display as normal.
Oh, and BTW, in my previous example I had rel="lightbox[plants]" on the <a> tag.
This is what LightBox uses to group images together.
If you turn this into rel="lightbox", then the images will all display individually without the “Image # of #” text, but you will not be able to navigate between them.
In my latest example I changed “plants” to “cats”.