Jump to content

getting list items one by one


sweetysweety

Recommended Posts

hi

 

i wrote a code like this:

$(function(){$(".ei-slider-thumbs li").live({			'mouseenter':function(){				$(".ei-slider-thumbs li img").css('visibility','visible').stop().animate({opacity:1,bottom:'20px'},{duration:400,easing:'swing'});				},			'mouseleave':function(){				$(".ei-slider-thumbs li img").css('visibility','hidden').stop().animate({opacity:0,bottom:'57px'},{duration:400,easing:'swing'});				}			});});

it shows picture when i hover on them but i have image standing on li's and i have more than one li's.i want to see the releated image when i hover on that.i try to write a code like:

$(".ei-slider-thumbs li").live({			'mouseenter':function(){				var index=$(".ei-slider-thumbs li").index($(this));				$(".ei-slider-thumbs li img").find('eq('+index+')').css('visibility','visible').stop().animate({opacity:1,bottom:'20px'},{duration:400,easing:'swing'});				},			'mouseleave':function(){				var index=$(".ei-slider-thumbs li").index($(this));				$(".ei-slider-thumbs li img").find('eq('+index+')').stop().animate({opacity:0,bottom:'57px'},{duration:400,easing:'swing'});				}			});

but it did not do anything.can anyone help me what i'm doing wrong?

Link to comment
Share on other sites

When I look at...

 

http://www.terranartworks.com/testsite/tsv1/islerimiz.html

 

I have no idea what it is that you want to do next. Perhaps you should label the different areas and then explain what you are trying to accomplish.

 

Also don't use live(). It is depreciated. Use on().

Edited by davej
Link to comment
Share on other sites

if you are targeting the img element associated with the 'ei-slider-thumbs li' current mouseover/mouseleave of , surely you just require.

 

IF you have more than one img

$(this).find('img').eq(0).css('visibility','visible').stop().animate({opacity:1,bottom:'20px'},{duration:400,easing:'swing'});

else

$(this).find('img').css('visibility','visible').stop().animate({opacity:1,bottom:'20px'},{duration:400,easing:'swing'});

would suffice.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...