Skip to content

Instantly share code, notes, and snippets.

@OscarGodson
Forked from zacparker/gist:811949
Created February 4, 2011 22:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OscarGodson/811957 to your computer and use it in GitHub Desktop.
Save OscarGodson/811957 to your computer and use it in GitHub Desktop.
jQuery(function(){
jQuery('.lcp_catlist li a')
//Set up the imgs for the green overlay
.find('img').css({
position:'relative',
zIndex:'1',
height: '120px',
width: '120px'
})
//Back to the <a>s
.end().each(function(){
jQuery(this).wrap('<div class="overlay_wrap"></div>')
.parent()
.css({ //the .overlay_wrap
position:'relative',
height: '120px',
width: '120px'
})
.prepend('<div class="overlay"></div>')
.find('.overlay')
.css({
background:'#4BB6A7',
display:'none',
position:'absolute',
top: '5px',
left: '3px',
height:'120px',
zIndex:'2',
width:'105px'
})
.click(function(){
$(this).siblings('a').click();
})
.end().find('img')
.hover(
function(){
jQuery(this).parent().parent().find('.overlay').fadeTo("fast",0.3).hover(function(){},function(){
jQuery(this).fadeTo("fast",0,function(){jQuery(this).css('display','none')});
});
}
);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment