I found this under Wordpress Creativity:
http://www.gavick.com/forums/creativity ... 27143.html
Can this be done in Joomla?
// add overlays
module.find('.gkImage').each(function(i, img) {
img = jQuery(img);
if(img.find('.gkImgOverlay').length == 0) {
// create overlays
var overlay = jQuery('<div class="gkImgOverlay"></div>');
overlay.html('<span></span>');
img.append(overlay);
// add overlay events
img.mouseenter( function() {
var overlay = img.find('.gkImgOverlay');
var realImg = img.find('img');
overlay.css({
'margin-left': (-1.0 * (realImg.width() / 2.0)) + "px",
'width': realImg.width() + "px"
});
overlay.attr('class', 'gkImgOverlay active');
});
img.mouseleave(function() {
var overlay = img.find('.gkImgOverlay');
overlay.attr('class', 'gkImgOverlay');
});
}
});
// add overlays
module.find('.gkImage').each(function(i, img) {
img = jQuery(img);
title = img.attr('title');
if(img.find('.gkImgOverlay').length == 0) {
// create overlays
var overlay = jQuery('<div class="gkImgOverlay"></div>');
overlay.html('<span><i>'+title+'</i></span>');
img.append(overlay);
// add overlay events
img.mouseenter( function() {
var overlay = img.find('.gkImgOverlay');
var realImg = img.find('img');
overlay.css({
'margin-left': (-1.0 * (realImg.width() / 2.0)) + "px",
'width': realImg.width() + "px"
});
overlay.attr('class', 'gkImgOverlay active');
});
img.mouseleave(function() {
var overlay = img.find('.gkImgOverlay');
overlay.attr('class', 'gkImgOverlay');
});
}
});
.gkNspPM-Portfolio .gkImagesWrapper > a > .gkImgOverlay > span:before {
border: 2px solid #fff;
-webkit-border-radius: 50%;
-moz-border-radius: 50%;
border-radius: 50%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
color: #fff;
content: "\f0c1";
font-family: FontAwesome;
font-size: 22px;
height: 52px;
left: 50%;
line-height: 50px;
margin: -32px 0 0 -32px;
opacity: 0; filter: alpha(opacity=0);
position: absolute;
text-align: center;
top: 65%;
-webkit-transition: all .2s ease-out;
-moz-transition: all .3s ease-out;
-ms-transition: all .3s ease-out;
-o-transition: all .3s ease-out;
transition: all .3s ease-out;
width: 52px;
}
.gkNspPM-Portfolio .gkImagesWrapper > a > .gkImgOverlay > span > i {
color: #fff;
font-size: 22px;
height: 52px;
line-height: 50px;
margin: -32px 0 0 0;
left: 0px;
opacity: 0; filter: alpha(opacity=0);
position: absolute;
text-align: center;
top: 65%;
-webkit-transition: all .2s ease-out;
-moz-transition: all .3s ease-out;
-ms-transition: all .3s ease-out;
-o-transition: all .3s ease-out;
transition: all .3s ease-out;
width: 100%;
}
.gkNspPM-Portfolio .gkImagesWrapper > a > .gkImgOverlay.active span:before {
opacity: 1; filter: alpha(opacity=100);
top: 50%;
}
.gkNspPM-Portfolio .gkImagesWrapper > a > .gkImgOverlay.active span i {
opacity: 1; filter: alpha(opacity=100);
top: 50%;
}
// add overlays
module.getElements('.gkImage').each(function(img) {
if(!img.getElement('.gkImgOverlay')) {
// create overlays
var overlay = new Element('div', { 'class' : 'gkImgOverlay' });
overlay.innerHTML = '<span></span>';
overlay.inject(img, 'bottom');
// add overlay events
img.addEvent('mouseenter', function() {
var overlay = img.getElement('.gkImgOverlay');
var realImg = img.getElement('img');
overlay.setStyles({
'margin-left': (-1.0 * (realImg.getSize().x / 2.0)) + "px",
'width': realImg.getSize().x + "px"
});
overlay.setProperty('class', 'gkImgOverlay active');
});
img.addEvent('mouseleave', function() {
var overlay = img.getElement('.gkImgOverlay');
overlay.setProperty('class', 'gkImgOverlay');
});
}
});
};
// add overlays
module.getElements('.gkImage').each(function(img) {
if(!img.getElement('.gkImgOverlay')) {
// create overlays
title = img.getProperty('title');;
var overlay = new Element('div', { 'class' : 'gkImgOverlay' });
overlay.innerHTML = '<span><i>'+title+'</i></span>';
overlay.inject(img, 'bottom');
// add overlay events
img.addEvent('mouseenter', function() {
var overlay = img.getElement('.gkImgOverlay');
var realImg = img.getElement('img');
overlay.setStyles({
'margin-left': (-1.0 * (realImg.getSize().x / 2.0)) + "px",
'width': realImg.getSize().x + "px"
});
overlay.setProperty('class', 'gkImgOverlay active');
});
img.addEvent('mouseleave', function() {
var overlay = img.getElement('.gkImgOverlay');
overlay.setProperty('class', 'gkImgOverlay');
});
}
});
};