Need help with a piece of code
My knowledge about jQuery is limited so i need some help, i want to use a slide up box in a image(this box contains a couple of thumbnails for every image). My problem is everytime i add a new images is have to ad a new class.
-
jQuery.fn.overl = function(classe) {
$(this).hover(function(){
$(this).find(classe).stop().animate({height:'70px',opacity: '0.9'},400);
},function () {
$(this).find(classe).stop().animate({height:'0',opacity: '0'}, 400);
});
}
$('.cycle-wrap').overl('.overlay-1, .overlay-2, .overlay-3');
as you can see is use 3 classes but i just want to use one. But if i use one class the thumbnails are not working correct.
I want to use the code below
-
$('.cycle-wrap').overl('.overlay-1');
I think the code must be placed in some kind of for each loop.
I hope somebody understands me, sorry for the bad Language english is not my main Language.
greetz