sweetysweety Posted August 22, 2013 Share Posted August 22, 2013 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 More sharing options...
davej Posted August 24, 2013 Share Posted August 24, 2013 (edited) 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 August 24, 2013 by davej Link to comment Share on other sites More sharing options...
sweetysweety Posted August 26, 2013 Author Share Posted August 26, 2013 i want to see when i hover on the grey button on the bottom,the little pictures should appears upper side of releated button. i can reach most of my wishes but when i hover the first button,the last button's image appearing. how can i fix this? Link to comment Share on other sites More sharing options...
dsonesuk Posted August 26, 2013 Share Posted August 26, 2013 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 More sharing options...
sweetysweety Posted August 26, 2013 Author Share Posted August 26, 2013 yeap.it worked:)thank you for your help:) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now